diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000000..c2021d8555 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "fsharp.formatting.commandtool": { + "version": "11.5.1", + "commands": [ + "fsdocs" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 9ffc7f9619..0000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- - -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 - -# Avoid warnings by switching to noninteractive -ENV DEBIAN_FRONTEND=noninteractive - -# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" -# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs -# will be updated to match your local UID/GID (when using the dockerFile property). -# See https://aka.ms/vscode-remote/containers/non-root-user for details. -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -# Configure apt and install packages -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ - # - # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed - && apt-get -y install git openssh-client less iproute2 procps lsb-release \ - # - # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. - && groupadd --gid $USER_GID $USERNAME \ - && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ - # [Optional] Add sudo support for the non-root user - && apt-get install -y sudo \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ - && chmod 0440 /etc/sudoers.d/$USERNAME \ - # - # Clean up - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* - -# Switch back to dialog for any ad-hoc use of apt-get -ENV DEBIAN_FRONTEND=dialog diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 970a9ca1c0..0000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,34 +0,0 @@ -// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.108.0/containers/dotnetcore-3.1-fsharp -{ - "name": "F# (.NET Core 3.1)", - "dockerFile": "Dockerfile", - - // Set *default* container specific settings.json values on container create. - // - // .NET Core is now the default for F# in .NET Core 3.0+ - // However, .NET Core scripting is not the default yet. Set that to true. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "FSharp.useSdkScripts":true, - "editor.trimAutoWhitespace": false, - "files.trimTrailingWhitespace": false, - "FSharp.suggestGitignore": false, - "FSharp.workspacePath": "FSharp.sln" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "Ionide.Ionide-fsharp", - "ms-dotnettools.csharp" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "./build.sh", - - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. - // "remoteUser": "vscode" -} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index db017a84e9..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,29 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs text diff=csharp -*.sln text eol=crlf merge=union -*.csproj text merge=union -*.vbproj text merge=union -*.fsproj text merge=union -*.dbproj text merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain - -*.sh text eol=lf -targets.make text eol=lf - -*.bsl linguist-vendored=true - -*.png binary diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 212c869a3e..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve F# -title: '' -labels: '' -assignees: '' - ---- - -Please provide a succinct description of the issue. - -**Repro steps** - -Provide the steps required to reproduce the problem: - -1. Step A -2. Step B - -If possible attach a zip file with the repro case. This often makes it easier for others to reproduce. -The zip file should ideally represent the situation just before the call/step that is problematic. - -**Expected behavior** - -Provide a description of the expected behavior. - -**Actual behavior** - -Provide a description of the actual behaviour observed. - -**Known workarounds** - -Provide a description of any known workarounds. - -**Related information** - -Provide any related information (optional): - -* Operating system -* .NET Runtime kind (.NET Core, .NET Framework, Mono) -* Editing Tools (e.g. Visual Studio Version, Visual Studio) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 0a66fd8d38..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for the F# tools or compiler -title: '' -labels: Feature Request -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 0aa81ef607..0000000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,5 +0,0 @@ -# FSharp.Compiler.Service Issue Template - -> Thanks for your intention to help out! - -We appreciate your enthusiasm, but this repository is a *read-only* fork of the official F# compiler. Please raise your issue at the [upstream repository](https://github.com/dotnet/fsharp/issues/new). diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 0e642c8927..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,5 +0,0 @@ -# FSharp.Compiler.Service Pull Request Template - -> Thanks for your intention to help out! - -We appreciate your enthusiasm, but this repository is a *read-only* fork of the official F# compiler. Please raise your Pull Request at the [upstream repository](https://github.com/dotnet/fsharp/compare). diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 76b0d57318..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build: - - strategy: - fail-fast: false - matrix: - os: [windows-latest, macos-latest, ubuntu-latest] - dotnet: [3.1.301] # TODO: wish this action didn't pin versions... - include: - - os: windows-latest - knownFailure: false - - os: macos-latest - knownFailure: true - - os: ubuntu-latest - knownFailure: true - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - name: Setup .Net Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{matrix.dotnet}} - - name: Restore tools - run: dotnet tool restore - working-directory: ./fcs - - name: Build - run: dotnet fake build -t Build - working-directory: ./fcs - - name: Test - run: dotnet fake build -s -t Test - working-directory: ./fcs - if: ${{ !matrix.knownFailure }} - - name: Archive code coverage results - uses: actions/upload-artifact@v2 - if: always() - with: - name: code-coverage-report-${{ matrix.os }}-${{ env.GITHUB_SHA }} - path: ${{ github.workspace }}/artifacts/TestResults/Release/FSharp.Compiler.Service.Test.*.xml \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d321ff2960..b3265de2fe 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,32 +3,38 @@ name: Release docs on: push: branches: - - master + - main + workflow_dispatch: jobs: build: - runs-on: macos-latest + strategy: + matrix: + os: [windows-latest] + dotnet: [5.0.400] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.301 + dotnet-version: 5.0.400 - name: Restore tools run: dotnet tool restore - working-directory: ./fcs - - name: Restore dependencies - run: dotnet restore - working-directory: ./fcs - - name: Run Fornax - run: dotnet fake build -t GenerateDocs - working-directory: ./fcs + - name: Restore projects + run: dotnet restore FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj + - name: Checkout fsharp master + run: git clone https://github.com/dotnet/fsharp --depth 1 fsharp -b main + - name: Build fsharp master (turn of CI build status) + run: cd fsharp && eng\CIBuild.cmd + - name: Run fsdocs + run: dotnet fsdocs build --sourcefolder fsharp - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: personal_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./fcs/docsrc/_public + publish_dir: ./output publish_branch: gh-pages - force_orphan: true \ No newline at end of file + force_orphan: true diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..6c55d2b513 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,32 @@ +name: Pull request checks + +on: + pull_request: + branches: + - '**' + +jobs: + build: + + strategy: + matrix: + os: [windows-latest] + dotnet: [5.0.400] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.400 + - name: Restore tools + run: dotnet tool restore + - name: Restore projects + run: dotnet restore FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj + - name: Checkout fsharp master + run: git clone https://github.com/dotnet/fsharp --depth 1 fsharp -b main + - name: Build fsharp master (turn of CI build status) + run: cd fsharp && eng\CIBuild.cmd + - name: Run fsdocs + run: dotnet fsdocs build --sourcefolder fsharp diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index fa38aac6ea..0000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish - -on: - push: - tags: - - '*' - -jobs: - build: - - strategy: - matrix: - os: [macos-latest] - dotnet: [3.1.301] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet }} - - name: Restore tools - run: dotnet tool restore - working-directory: ./fcs - - name: Build and package - run: dotnet fake build -t NuGet - working-directory: ./fcs - # TODO: fix the version-differ to be able to handle the same type across different versions of the contributing dll - # - name: Validate package bump - # run: dotnet fake build -s -t ValidateVersionBump - # working-directory: ./fcs - - name: Create release - run: dotnet fake build -s -t CreateRelease - working-directory: ./fcs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to nuget - run: dotnet fake build -s -t PublishNuget - working-directory: ./fcs - env: - NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} - - \ No newline at end of file diff --git a/.gitignore b/.gitignore index d047a21cdb..6e2e1f7f49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,246 +1,12 @@ -# output location -artifacts/ - -/tests/scripts/current -.dotnet/ -.packages/ -.tools/ - -# Patches that may have been generated by scripts. -# (These aren't generally useful to commit directly; if anything, they should be applied.) -scripts/*.patch -/fcs/FSharp.Compiler.Service/illex.fs -/fcs/FSharp.Compiler.Service/ilpars.fs -/fcs/FSharp.Compiler.Service/ilpars.fsi -/fcs/FSharp.Compiler.Service/lex.fs -/fcs/FSharp.Compiler.Service/pars.fs -/fcs/FSharp.Compiler.Service/pars.fsi -/fcs/FSharp.Compiler.Service/pplex.fs -/fcs/FSharp.Compiler.Service/pppars.fs -/fcs/FSharp.Compiler.Service/pppars.fsi -/src/*.userprefs -/src/fsharp/FSStrings.resources -/src/fsharp/FSharp.Build/*.resx -/src/fsharp/FSharp.Build-proto/*.resx -/src/fsharp/FSharp.Build-proto/*.resources -/src/fsharp/FSharp.Compiler-proto/*.resx -/src/fsharp/FSharp.Compiler-proto/*.resources -/src/fsharp/FSharp.Compiler-proto/*.sln -/src/fsharp/FSharp.Compiler-proto/*.userprefs -/src/fsharp/fsi/*.resx -/src/fsharp/FSharp.Compiler.Interactive.Settings/*.resx -/src/fsharp/FSharp.Compiler.Server.Shared/*.resx -/src/fsharp/fsi/Fsi.sln -/src/fsharp/FSharp.Build/*.resources -/src/fsharp/FSharp.Compiler.Private/*.resx -/src/fsharp/FSharp.Compiler.Private/*.resources -/src/fsharp/FSharp.Compiler.Private/*.sln -/src/fsharp/FSharp.Compiler.Private/*.userprefs -/src/*.log -/src/fsharp/Fsc-proto/illex.fs -/src/fsharp/Fsc-proto/ilpars.fs -/src/fsharp/Fsc-proto/ilpars.fsi -/src/fsharp/Fsc-proto/lex.fs -/src/fsharp/Fsc-proto/pars.fs -/src/fsharp/Fsc-proto/pars.fsi -/src/fsharp/Fsc-proto/pplex.fs -/src/fsharp/Fsc-proto/pppars.fs -/src/fsharp/Fsc-proto/pppars.fsi -/src/fsharp/FSharp.LanguageService.Compiler/illex.* -/src/fsharp/FSharp.LanguageService.Compiler/ilpars.* -/src/fsharp/FSharp.LanguageService.Compiler/lex.* -/src/fsharp/FSharp.LanguageService.Compiler/pars.* -/src/fsharp/FSharp.LanguageService.Compiler/pplex.fs -/src/fsharp/FSharp.LanguageService.Compiler/pppars.fs -/src/fsharp/FSharp.LanguageService.Compiler/pppars.fsi -/src/fsharp/*/Properties/launchSettings.json -/vsintegration/src/unittests/Unittests.fsi -/tests/*FSharp_Failures.env -/tests/*FSharp_Failures.lst -/tests/fsharpqa/testenv/bin/ -/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll -/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb -/tests/Xnet40-fsharpqa-suite-failures.log.* -/tests/fsharp/typeProviders/splitAssemblyTools/provider.dll -/tests/fsharp/typeProviders/splitAssemblyTypeproviders/provider.dll -/vsintegration/src/service/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi -/vsintegration/src/service/FsPkgs/FSharp.Project/FS/ctofiles/ -/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll -/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll -/tests/fsharpqa/Source/*net40-fsharpqa-suite-failures.env -/tests/fsharpqa/Source/*net40-fsharpqa-suite-failures.lst -/tests/**/FSharp.Core.dll -/tests/fsharp/optimize/stats/FSharpOptimizationInfo.FSharp.Core -/tests/fsharp/optimize/stats/FSharpSignatureInfo.FSharp.Core -lib/debug -lib/release -lib/proto -lib/bootstrap/4.1/*.mdb -lib/bootstrap/4.1/*.xml -lib/bootstrap/4.1/fsharpc -lib/bootstrap/4.1/fsharpi -lib/bootstrap/4.1/policy* -obj/ -bin/ -aclocal.m4 -src/*.userprefs -src/fsharp/FSStrings.resources packages -src/fsharp/FSharp.Build/*.resx -src/fsharp/FSharp.Build-proto/*.resx -src/fsharp/FSharp.Build-proto/*.resources -src/fsharp/FSharp.Compiler-proto/*.resx -src/fsharp/FSharp.Compiler-proto/*.resources -src/fsharp/FSharp.Compiler-proto/*.sln -src/fsharp/FSharp.Compiler-proto/*.userprefs -src/fsharp/fsi/*.resx -src/fsharp/FSharp.Compiler.Interactive.Settings/*.resx -src/fsharp/FSharp.Compiler.Server.Shared/*.resx -src/fsharp/fsi/Fsi.sln -src/fsharp/FSharp.Build/*.resources -src/fsharp/FSharp.Compiler/*.resx -src/fsharp/FSharp.Compiler/*.resources -src/fsharp/FSharp.Compiler/*.sln -src/fsharp/FSharp.Compiler/*.userprefs -Debug -Release -Proto -sign_temp -.libs -configure -config.log -config.status -src/fsharp/FSharp.Compiler/illex.fs -src/fsharp/FSharp.Compiler/ilpars.fs -src/fsharp/FSharp.Compiler/ilpars.fsi -src/fsharp/FSharp.Compiler/lex.fs -src/fsharp/FSharp.Compiler/pars.fs -src/fsharp/FSharp.Compiler/pars.fsi -src/fsharp/FSharp.Compiler/pplex.fs -src/fsharp/FSharp.Compiler/pppars.fs -src/fsharp/FSharp.Compiler/pppars.fsi -src/fsharp/FSharp.Compiler-proto/illex.fs -src/fsharp/FSharp.Compiler-proto/ilpars.fs -src/fsharp/FSharp.Compiler-proto/ilpars.fsi -src/fsharp/FSharp.Compiler-proto/lex.fs -src/fsharp/FSharp.Compiler-proto/pars.fs -src/fsharp/FSharp.Compiler-proto/pars.fsi -src/fsharp/FSharp.Compiler.Silverlight/lex.fs -src/fsharp/FSharp.Compiler.Silverlight/pars.fs -src/fsharp/FSharp.Compiler.Silverlight/pars.fsi -src/fsharp/FSharp.Compiler-proto/pplex.fs -src/fsharp/FSharp.Compiler-proto/pppars.fs -src/fsharp/FSharp.Compiler-proto/pppars.fsi - -*~ -*.suo -obj -src/fsharp/FSharp.Data.TypeProviders/FSData.resx -src/fsharp/fsiAnyCpu/FSIstrings.resx - -*.nupkg - -bin -packages -*.bak -temp/ -src/fsharp/fsi/FSIStrings.fs - -src/fsharp/FSharp.Compiler.Service/FSComp.resx -src/fsharp/FSharp.Compiler.Service/FSIstrings.resx -src/fsharp/FSharp.Compiler.Service/illex.fs -src/fsharp/FSharp.Compiler.Service/ilpars.fs -src/fsharp/FSharp.Compiler.Service/ilpars.fsi -src/fsharp/FSharp.Compiler.Service/lex.fs -src/fsharp/FSharp.Compiler.Service/pars.fs -src/fsharp/FSharp.Compiler.Service/pars.fsi -TestResults.xml -*.userprefs -extras -ossreadme*.txt -*.XML -src/assemblyinfo/assemblyinfo.shared.fs -*.csproj.user -src/fsharp/FSharp.LanguageService.Compiler/illex.* -src/fsharp/FSharp.LanguageService.Compiler/ilpars.* -src/fsharp/FSharp.LanguageService.Compiler/lex.* -src/fsharp/FSharp.LanguageService.Compiler/pars.* -vsintegration/src/unittests/Unittests.fsi -vsintegration/src/FSharp.ProjectSystem.FSharp/ctofiles/MenusAndCommands.cto -tests/*FSharp_Failures.env -tests/*FSharp_Failures.lst -tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll -tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb -tests/XFSharpQA_Failures.log.* -vsintegration/src/vs/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi -vsintegration/src/vs/FsPkgs/FSharp.Project/FS/ctofiles/ -tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll -tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll -packages -FSharp.Compiler.Tools.Nuget/*.nupkg -FSharp.Core.Nuget/*.nupkg -tests/fsharpqa/Source/*FSharpQA_Failures.env -tests/fsharpqa/Source/*FSharpQA_Failures.lst -*.csproj.user -*.fsproj.user -*.vbproj.user -*.sln.DotSettings.user -*.log -*.jrs -*.chk -*.bak -FSharp.Compiler.Tools.Nuget/*.nupkg -FSharp.Core.Nuget/*.nupkg -artifacts/*.nupkg -*.bak -*.vserr -*.err -*.orig -*.mdf -*.ldf -.paket/paket.exe paket-files -docsrc/tools/FSharp.Formatting.svclog -src/fsharp/FSharp.Compiler.Service/pplex.fs -src/fsharp/FSharp.Compiler.Service/pppars.fs -src/fsharp/FSharp.Compiler.Service/pppars.fsi -.fake -*.cto -*.vstman -project.lock.json -src/fsharp/FSharp.Compiler.Service/FSComp.fs -src/fsharp/FSharp.Compiler.Service/FSComp.resx -src/fsharp/FSharp.Compiler.Service/FSIstrings.fs -src/fsharp/FSharp.Compiler.Service/FSIstrings.resx -Tools/ -Backup/ -tests/fsharp/core/array/dont.run.peverify -tests/fsharp/core/innerpoly/dont.run.peverify -tests/fsharp/typecheck/sigs/neg94-pre.dll -times -/tests/fsharpqa/testenv/bin/System.ValueTuple.dll -source_link.json -.vs/ -System.ValueTuple.dll -tests/fsharpqa/testenv/bin/System.ValueTuple.dll -**/.fake -lib/netcore/fsc/bin/ -!lib/bootstrap/signed/**/* -/fcs/packages/ -*/paket-files/ -/fcs/TestResult.xml -/tests/fcs/ -/fcs/.paket/Paket.Restore.targets -msbuild.binlog -/fcs/FSharp.Compiler.Service.netstandard/*.fs -/fcs/FSharp.Compiler.Service.netstandard/*.fsi .ionide +_public .vscode -**/.DS_Store -/tests/fsharp/regression/5531/compilation.output.test.txt -/tests/fsharp/core/fsfromfsviacs/compilation.langversion.old.output.txt -/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.txt -*ncrunch*.user -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* +.paket +fsharp/ +FSharp.Formatting/ +.fsdocs/ +FSharp.Compiler.Service/obj/ +tmp/ + diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d763943d4e..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "editor.trimAutoWhitespace": false, - "files.trimTrailingWhitespace": false, - "FSharp.suggestGitignore": false, - "FSharp.workspacePath": "FSharp.sln" -} \ No newline at end of file diff --git a/.vsconfig b/.vsconfig deleted file mode 100644 index 302d980890..0000000000 --- a/.vsconfig +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "1.0", - "components": [ - "Microsoft.VisualStudio.Component.CoreEditor", - "Microsoft.VisualStudio.Workload.CoreEditor", - "Microsoft.VisualStudio.Component.NuGet", - "Microsoft.Net.Component.4.6.1.TargetingPack", - "Microsoft.VisualStudio.Component.Roslyn.Compiler", - "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", - "Microsoft.VisualStudio.Component.FSharp", - "Microsoft.Net.Core.Component.SDK.2.1", - "Microsoft.NetCore.ComponentGroup.DevelopmentTools.2.1", - "Microsoft.Net.Component.4.7.2.SDK", - "Microsoft.Net.Component.4.7.2.TargetingPack", - "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", - "Microsoft.Component.MSBuild", - "Microsoft.VisualStudio.Component.TextTemplating", - "Microsoft.VisualStudio.Component.ManagedDesktop.Core", - "Microsoft.Net.Component.4.6.TargetingPack", - "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", - "Microsoft.VisualStudio.Component.FSharp.Desktop", - "Microsoft.VisualStudio.Workload.ManagedDesktop", - "Microsoft.VisualStudio.Component.VSSDK", - "Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites", - "Microsoft.VisualStudio.Workload.VisualStudioExtension" - ] -} diff --git a/Build.cmd b/Build.cmd deleted file mode 100644 index ad55484933..0000000000 --- a/Build.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore %*" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..216ec7e2bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at fsharp@fsharp.org. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 99a475b0d6..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -# Contributing to FSharp.Compiler.Service - -> Thanks for your intention to help out! - -We appreciate your enthusiasm, but this repository is a *read-only* fork of the official F# compiler. If you have issues, contributions, or questions, please raise them at the [upstream repository](https://github.com/dotnet/fsharp). diff --git a/CoordinateXlif.targets b/CoordinateXlif.targets deleted file mode 100644 index ea1ed17aaa..0000000000 --- a/CoordinateXlif.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props deleted file mode 100644 index e9c2a5c5e9..0000000000 --- a/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Directory.Build.targets b/Directory.Build.targets deleted file mode 100644 index 08da3ab096..0000000000 --- a/Directory.Build.targets +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj new file mode 100644 index 0000000000..308c6da3dd --- /dev/null +++ b/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -0,0 +1,42 @@ + + + + netstandard2.0 + F# Software Foundation; Microsoft; F# Contributors + The core library for F# + The core library F# + Copyright 2003-2020 + true + + true + Library + false + true + MIT + 4.7.2 + true + + + + $(MSBuildThisFileDirectory)..\..\fsharp\artifacts\bin\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.dll + + + $(MSBuildThisFileDirectory)..\fsharp\artifacts\bin\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.dll + + + + + https://github.com/dotnet/fsharp/blob/main/License.txt + https://fsharp.github.io/fsharp-core-docs/ + https://fsharp.org/img/logo/fsharp128.png + F#;async;fsharp;streaming + https://github.com/dotnet/fsharp/ + https://fsharp.org + https://github.com/dotnet/fsharp/blob/main/License.txt + https://github.com/dotnet/fsharp/blob/main/release-notes.md + git + true + + + + diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props deleted file mode 100644 index 1abb6c8a95..0000000000 --- a/FSharp.Profiles.props +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - $(DefineConstants);CROSS_PLATFORM_COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT - - - - $(DefineConstants);NETSTANDARD - $(DefineConstants);FX_NO_APP_DOMAINS - $(DefineConstants);FX_NO_CORHOST_SIGNER - $(DefineConstants);FX_NO_PDB_READER - $(DefineConstants);FX_NO_PDB_WRITER - $(DefineConstants);FX_NO_SYMBOLSTORE - $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION - $(DefineConstants);FX_NO_WIN_REGISTRY - $(DefineConstants);FX_NO_WINFORMS - $(DefineConstants);FX_NO_INDENTED_TEXT_WRITER - $(DefineConstants);FX_RESHAPED_REFEMIT - $(OtherFlags) --simpleresolution - - - diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props deleted file mode 100644 index 681a3d3c70..0000000000 --- a/FSharpBuild.Directory.Build.props +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - true - - - - - $(RepoRoot)src - $(RepoRoot)tests - $(ArtifactsDir)\SymStore - $(ArtifactsDir)\Bootstrap - 4.4.0 - 1182;0025;$(WarningsAsErrors) - - - - - $(MSBuildThisFileDirectory)icon.png - - - $(RestoreAdditionalProjectSources);$(ArtifactsPackagesDir) - $(ArtifactsPackagesDir) - - - $(NUGET_PACKAGES) - $(UserProfile)\.nuget\packages\ - $(HOME)/.nuget/packages/ - - - $(NuGetPackageRoot)\ - $(NuGetPackageRoot)/ - - - true - - - - - /usr - /Library/Frameworks/Mono.framework/Versions/Current - $(MonoRoot)/lib/mono - true - $(MonoLibFolder)/4.5-api - $(MonoLibFolder)/4.5.1-api - $(MonoLibFolder)/4.5.2-api - $(MonoLibFolder)/4.6-api - $(MonoLibFolder)/4.6.1-api - $(MonoLibFolder)/4.6.2-api - $(MonoLibFolder)/4.7-api - $(MonoLibFolder)/4.7.1-api - $(MonoLibFolder)/4.7.2-api - - - - - Microsoft - - - $(FSharpSourcesRoot)\fsharp\test.snk - false - STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY;$(DefineConstants) - - - - - false - true - - - - - false - false - https://github.com/Microsoft/visualfsharp - git - - - - <_DotGitDir>$(RepoRoot).git - <_HeadFileContent Condition="Exists('$(_DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(_DotGitDir)/HEAD').Trim()) - <_RefPath Condition="$(_HeadFileContent.StartsWith('ref: '))">$(_DotGitDir)/$(_HeadFileContent.Substring(5)) - $(BUILD_SOURCEVERSION) - $([System.IO.File]::ReadAllText('$(_RefPath)').Trim()) - - - - - $(NoWarn);FS2003 - true - embedded - fs - false - true - - - - $(DefineConstants);TESTING_ON_LINUX - - - - - $(ProtoOutputPath)\fsc\Microsoft.FSharp.Targets - $(ProtoOutputPath)\fsc\Microsoft.FSharp.NetSdk.props - $(ProtoOutputPath)\fsc\Microsoft.FSharp.NetSdk.targets - $(ProtoOutputPath)\fsc\Microsoft.FSharp.Overrides.NetSdk.targets - - - diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets deleted file mode 100644 index 256688bd2a..0000000000 --- a/FSharpBuild.Directory.Build.targets +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - <__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') - <__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)') - <__TargetLink>@(NoneSubstituteText->'%(Link)') - - <_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)')) - <_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)')) - <_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)')) - <_ReplacementText Condition="'%(NoneSubstituteText.Pattern3)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern3)', '%(NoneSubstituteText.Replacement3)')) - - <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory) - <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never - - <_IncludeInVsix>false - <_IncludeInVsix Condition="'%(NoneSubstituteText.IncludeInVsix)' == 'true'">true - - - - - - - - - - - - - - - - <_BuildPropertyLines Remove="@(_BuildPropertyLines)" /> - <_BuildPropertyLines Include="// <auto-generated >" /> - <_BuildPropertyLines Include="// <Generated by the FSharp WriteCodeFragment class./>" /> - <_BuildPropertyLines Include="// </auto-generated/>" /> - <_BuildPropertyLines Include="//" /> - <_BuildPropertyLines Include="module internal FSharp.BuildProperties" /> - <_BuildPropertyLines Include="let fsProductVersion = "$(FSPRODUCTVERSION)"" /> - <_BuildPropertyLines Include="let fsLanguageVersion = "$(FSLANGUAGEVERSION)"" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props deleted file mode 100644 index 90d7376140..0000000000 --- a/FSharpTests.Directory.Build.props +++ /dev/null @@ -1,47 +0,0 @@ - - - - true - - - - true - - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net472 - fsc.exe - - - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net472 - fsi.exe - - - - - true - - $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) - dotnet.exe - dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp3.1\fsc.exe - - $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) - dotnet.exe - dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp3.1\fsi.exe - - - - - <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472 - <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp3.1 - <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework) - - $(_FSharpBuildBinPath)\FSharp.Build.dll - - $(_FSharpBuildBinPath)/Microsoft.FSharp.Targets - $(_FSharpBuildBinPath)/Microsoft.FSharp.NetSdk.props - $(_FSharpBuildBinPath)/Microsoft.FSharp.NetSdk.targets - $(_FSharpBuildBinPath)/Microsoft.FSharp.Overrides.NetSdk.targets - - - diff --git a/INTERNAL.md b/INTERNAL.md deleted file mode 100644 index 15550dcedc..0000000000 --- a/INTERNAL.md +++ /dev/null @@ -1,60 +0,0 @@ -# Links for internal team members to find build definitions, etc. - -Note that usually only the most recent link in each section is interesting. Older links are included for reference only. - -## PR Build Definition - -The PR build definition can be found [here](https://dev.azure.com/dnceng/public/_build?definitionId=496) or by -navigating through an existing PR. - -## Signed Build Definitions - -[VS 16.4 to current](https://dev.azure.com/dnceng/internal/_build?definitionId=499&_a=summary) - -[VS 15.7 to 16.3](https://dev.azure.com/devdiv/DevDiv/_build/index?definitionId=8978) - -[VS 15.6](https://dev.azure.com/devdiv/DevDiv/_build?definitionId=7239) - -[VS 15.0 to 15.5](https://dev.azure.com/devdiv/DevDiv/_build?definitionId=5037) - -## VS Insertion Generators - -VS 16.4 to current - part of the build definition. [See below](#vs-insertions-as-part-of-the-build-definition). - -The following insertion generators are automatically invoked upon successful completion of a signed build in each of -their respective branches. - -[VS 16.3](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1839&_a=releases) - -[VS 16.2](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1699&_a=releases) - -[VS 16.1](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1669&_a=releases) - -VS 16.0 and prior were done manually - -## VS Insertions as part of the build definition - -Starting with the 16.4 release and moving forwards, the VS insertion is generated as part of the build. The relevant -bits can be found near the bottom of [`azure-pipelines.yml`](azure-pipelines.yml) under the `VS Insertion` header. The -interesting parameters are `componentBranchName` and `insertTargetBranch`. In short, when an internal signed build -completes and the name of the branch built exactly equals the value in the `componentBranchName` parameter, a component -insertion into VS will be created into the `insertTargetBranch` branch. The link to the insertion PR will be found -near the bottom of the build under the title 'Insert into VS'. Examine the log for 'Insert VS Payload' and near the -bottom you'll see a line that looks like `Created request #xxxxxx at https://...`. - -To see all insertions created this way (possibly including for other internal teams), check -[here](https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequests?createdBy=122d5278-3e55-4868-9d40-1e28c2515fc4&_a=active). - -## Less interesting links - -[Nightly VSIX (master) uploader](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=70). Uploads -a package from every build of `master` to the [Nightly VSIX feed](README.md#using-nightly-releases-in-visual-studio). - -[Nightly VSIX (preview) uploader](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=71). Uploads -a package from every build of the branch that corresponds to the current Visual Studio preview to the -[Preview VSIX feed](README.md#using-nightly-releases-in-visual-studio). - -[MyGet package uploader](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=69). Uploads various -packages for internal consumption. Feed URL is `https://dotnet.myget.org/F/fsharp/api/v3/index.json`. - -[Internal source mirror](https://dev.azure.com/dnceng/internal/_git/dotnet-fsharp). diff --git a/LICENSE b/LICENSE index 20daa663dc..6167060e50 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) Microsoft Corporation. -All rights reserved. +Copyright (c) 2020 F# Software Foundation Repositories Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Language-Version-History.md b/Language-Version-History.md deleted file mode 100644 index 72da5b5b33..0000000000 --- a/Language-Version-History.md +++ /dev/null @@ -1,107 +0,0 @@ -Features Added in F# Language Versions -==================== - -# [F# 1.0](https://docs.microsoft.com/en-us/archive/blogs/dsyme/welcome-to-dons-f-blog) - -- Discriminated unions -- Records -- Tuples -- Pattern matching -- Type abbreviations -- Object expressions -- Structs -- Signature files -- Imperative programming -- Modules (no functors) -- Nested modules -- .NET Interoperability - -# [F# 1.1](https://docs.microsoft.com/en-us/archive/blogs/dsyme/a-taste-of-whats-new-in-f-1-1) - -- Interactive environment -- Object programming -- Encapsulation Extensions - -# [F# 2.0](https://fsharp.org/specs/language-spec/2.0/FSharpSpec-2.0-April-2012.pdf) - -- Active patterns -- Units of measure -- Sequence expressions -- Asynchronous programming -- Agent programming -- Extension members -- Named arguments -- Optional arguments -- Array slicing -- Quotations -- Native interoperability -- Computation expressions - -# [F# 3.0](https://fsharp.org/specs/language-spec/3.0/FSharpSpec-3.0-final.pdf) - -- Type providers -- LINQ query expressions -- CLIMutable attribute -- Triple-quoted strings -- Auto-properties -- Provided units-of-measure - -# [F# 3.1](https://fsharp.org/specs/language-spec/3.1/FSharpSpec-3.1-final.pdf) - -- Named union type fields -- Extensions to array slicing -- Type inference enhancements - -# [F# 4.0](https://fsharp.org/specs/language-spec/4.0/FSharpSpec-4.0-final.pdf) - -- `printf` on unitized values -- Extension property initializers -- Non-null provided types -- Primary constructors as functions -- Static parameters for provided methods -- `printf` interpolation -- Extended `#if` grammar -- Multiple interface instantiations -- Optional type args -- Params dictionaries - -# [F# 4.1](https://fsharp.org/specs/language-spec/4.1/FSharpSpec-4.1-latest.pdf) - -- Struct tuples which inter-operate with C# tuples -- Struct annotations for Records -- Struct annotations for Single-case Discriminated Unions -- Underscores in numeric literals -- Caller info argument attributes -- Result type and some basic Result functions -- Mutually referential types and modules within the same file -- Implicit `Module` syntax on modules with shared name as type -- Byref returns, supporting consuming C# `ref`-returning methods -- Error message improvements -- Support for `fixed` - -# [F# 4.5](https://docs.microsoft.com/en-us/dotnet/fsharp/whats-new/fsharp-45) - -- Versioning alignment of binary, package, and language -- Support for `Span<'T>` and related types -- Ability to produce `byref` returns -- The `voidptr` type -- The `inref<'T>` and `outref<'T>` types to represent readonly and write-only `byref`s -- `IsByRefLike` structs -- `IsReadOnly` structs -- Extension method support for `byref<'T>`/`inref<'T>`/`outref<'T>` -- `match!` keyword in computation expressions -- Relaxed upcast with `yield` in F# sequence/list/array expressions -- Relaxed indentation with list and array expressions -- Enumeration cases emitted as public - -# [F# 4.6](https://docs.microsoft.com/en-us/dotnet/fsharp/whats-new/fsharp-46) - -- Anonymous records -- `ValueOption` module functions - -# [F# 4.7](https://docs.microsoft.com/en-us/dotnet/fsharp/whats-new/fsharp-47) - -- Compiler support for `LangVersion` -- Implicit `yield`s -- No more required double underscore (wildcard identifier) -- Indentation relaxations for parameters passed to constructors and static methods diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index 97aafe6f10..0000000000 --- a/NuGet.config +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/README.md b/README.md index 3a627bd4ba..0b604c3dcf 100644 --- a/README.md +++ b/README.md @@ -1,102 +1,92 @@ -# OLD NOTES - ARCHIVED REPO, NOW MERGED with [dotnet/fsharp](https://github.com/dotnet/fsharp) +# FSharp.Compiler.Service API documentation generation +https://fsharp.github.io/FSharp.Compiler.Service ------------------------- +## Contributing to Library Content +To improve the content of the FSharp.Compiler.Service library documentation, contribute to the XML `///` documentation in the +signature files (`*.fsi`) in the FSharp.Compiler.Service implementation. -# F# Compiler Service (OLD NOTES - ARCHIVED REPO, NOW MERGED with [dotnet/fsharp](https://github.com/dotnet/fsharp)) +* Fork and clone https://github.com/dotnet/fsharp locally, see below, as a subdirectory of your copy of `fsharp-core-docs` -The FSharp.Compiler.Service package contains a custom build of the F# compiler that -exposes additional functionality for implementing F# language bindings, additional -tools based on the compiler or refactoring tools. The package also includes F# -interactive service that can be used for embedding F# scripting into your applications. This repository exists entirely to create and publish that package. +* Contribute to [the src/fsharp directory](https://github.com/dotnet/fsharp/tree/master/src/fsharp) -## Purpose +* Use a local build, see below -> This repo is (mostly) **read only** +* Submit work to `main` branch of https://github.com/dotnet/fsharp -This repo exists as a downstream packaging repository for the [FSharp.Compiler.Service](https://www.nuget.org/packages/FSharp.Compiler.Service) NuGet Package. It serves the following purposes _only_: +* Once accepted your work will be published through a rebuild here, so submit a dummy pull request here +## Contributing to Generation of API Docs -* Release packaging -* Hosting [public documentation](http://fsharp.github.io/FSharp.Compiler.Service/) -* Serving as a stable base for Fable +The docs are generated by using `fsdocs` tool from FSharp.Formatting. If you want to improve the generation process: -It is a fork of the official F# source repository, which is located at [dotnet/fsharp](https://github.com/dotnet/fsharp). **All** issues and contributions should be raised there. All feature development should be targeted there. Once contributions are accepted into [dotnet/fsharp](https://github.com/dotnet/fsharp), they will be integrated into this repository for packaging and release. +* Contribute to the API Docs mode and/or HTML generator in [FSharp.Formatting.ApiDocs](https://github.com/fsprojects/FSharp.Formatting/tree/master/src/FSharp.Formatting.ApiDocs) and [the `fsdocs` tool](https://github.com/fsprojects/FSharp.Formatting/tree/master/src/FSharp.Formatting.CommandTool) -If you need to add customizations to FSharp.Compiler.Service for your own uses, you should clone [dotnet/fsharp](https://github.com/dotnet/fsharp) and build the FSharp.Compiler.Service binaries from there. The process is exactly the same as it is described below. +* Use a local copy of these, see below, as a subdirectory of fsharp-core-docs -### No contribution is too small +* Submit work to the `master` branch of https://github.com/fsprojects/FSharp.Formatting -Even if you find a single-character typo, we're happy to take the change! Although the codebase can feel daunting for beginners, we and other contributors are happy to help you along. +* Once accepted the new tooling will be published through a rebuild here, so submit a dummy pull request here that increments dummyVersion.txt -## Documentation +## Contributing to Layout and Design -For more information about the project, see: +These pages are currently using [the default template of the FSharp.Formatting tools](https://github.com/fsprojects/FSharp.Formatting/blob/master/docs/_template.html) +with its small amount of corresponding [CSS and JavaScript](https://github.com/fsprojects/FSharp.Formatting/tree/master/docs/content) - * [F# Compiler Service API and usage documentation](http://fsharp.github.io/FSharp.Compiler.Service/) - * [Description of the project structure](http://fsharp.github.io/FSharp.Compiler.Service/devnotes.html) +See [FSharp.Formatting styling](https://fsprojects.github.io/FSharp.Formatting/styling.html) for information on styling for output generated by `fsdocs`. -## Build and Test +This template is *not* the long term plan (unless it is improved enough). We can improve the design - please help with this. -On Windows: +1. Copy the default template and CSS to `docs`. Rebuild as before. This template will be used instead of the default template. - .\fcs\build.cmd Test +2. After you have identified fixes and improvements, contribute back to the default template of FSharp.Formatting, or submit your work here and we can assess that. This will help improve many F# libraries. -On Linux: +Whatever improvements you make should eventually get copied across back into FSharp.Formatting (and the duplicated template and styling will then likely be removed from this repo once it's no longer needed). If the design diverges to be a completely different look and feel then we can make several templates available in FSharp.Formatting with this as one of them. - ./fcs/build.sh Test -To build NuGet packages: +## Build steps - build NuGet - build TestAndNuGet +Eventually the build will just be -## Build Status + dotnet tool restore + dotnet restore FSharp.Compiler.Service + dotnet fsdocs build -Branch | OS | Badge | ------- | ------ | - | -master | Linux/OSX | [![Build Status](https://travis-ci.org/fsharp/FSharp.Compiler.Service.svg?branch=master)](https://travis-ci.org/fsharp/FSharp.Compiler.Service) | -master | Windows | [![Build status](https://ci.appveyor.com/api/projects/status/3yllu2qh19brk61d?svg=true)](https://ci.appveyor.com/project/fsgit/fsharp-compiler-service) | +For now, we want to pick up the latest copies of FSharp.Formatting and FSharp.Compiler.Service, and set you up to make contributions to these. So we ask you to clone local copies of these: -## NuGet package + (start in 'fsharp-core-docs') + dotnet restore FSharp.Compiler.Service -[![NuGet Badge](https://buildstats.info/nuget/FSharp.Compiler.Service)](https://www.nuget.org/packages/FSharp.Compiler.Service) + (make 'fsharp-core-docs/fsharp' and 'fsharp-core-docs/FSharp.Formatting' ) + git clone https://github.com/dotnet/fsharp --depth 1 -b main + git clone https://github.com/fsprojects/FSharp.Formatting --depth 1 -Stable builds are available in the NuGet Gallery: -[https://www.nuget.org/packages/FSharp.Compiler.Service](https://www.nuget.org/packages/FSharp.Compiler.Service) + (build 'fsharp-core-docs/fsharp') + pushd fsharp + .\build -noVisualStudio + popd -All AppVeyor builds are available using the NuGet feed: https://ci.appveyor.com/nuget/fsgit-fsharp-compiler-service + (build 'fsharp-core-docs/FSharp.Formatting') + pushd FSharp.Formatting + .\build -t Build + popd -* [The F# Compiler Technical Guide](https://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html) -* [The F# Language Specification](https://fsharp.org/specs/language-spec/) +Then do iterative development using: -## License + (from 'fsharp-core-docs') + FSharp.Formatting\src\FSharp.Formatting.CommandTool\bin\Release\netcoreapp3.1\fsdocs.exe watch --sourcefolder fsharp -This project is subject to the MIT License. A copy of this license is in [License.txt](License.txt). +## CI Pipeline -## Code of Conduct +This repo is published via GitHub Actions. On each push to master, the docs are built, and the outputs (which are written to the `output` directory by fsdocs) are pushed to the `gh-pages` branch. This repo is configured to host using GitHub Pages from this branch, so once the generated files are pushed the update is nearly-instant. -This project has adopted the [Contributor Covenant](https://contributor-covenant.org/) code of conduct to clarify expected behavior in our community. You can read it at [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md). +To build the very latest and freshest docs using the latest `fsdocs` tooling the CI does this: -## Get In Touch +1. build dotnet/fsharp `main` branch (where we assume latest doc updates have been pushed) -Members of the [F# Software Foundation](https://fsharp.org) are invited to the [FSSF Slack](https://fsharp.org/guides/slack/). You can find support from other contributors in the `#compiler` and `#editor-support` channels. +2. builds `FSharp.Formatting` master branch -Additionally, you can use the `#fsharp` tag on Twitter if you have general F# questions, including about this repository. Chances are you'll get multiple responses. +3. Uses that `FSharp.Formatting` tool to build the docs for the FSharp.Compiler.Service built in step 1 -The maintainers of this repository are: - - - [Don Syme](http://github.com/dsyme) - - [Tomas Petricek](http://github.com/tpetricek) - - [Enrico Sada](http://github.com/enricosada) - - [Chet Husk](http://github.com/baronfel) - - Many people have helped including [Robin Neatherway](https://github.com/rneatherway), [Dave Thomas](http://github.com/7sharp9), [Lincoln Atkinson](http://github.com/latkin), [Kevin Ransom](http://github.com/KevinRansom), [Vladimir Matveev](http://github.com/vladima) and others - -## About F\# - -* [What is F#](https://docs.microsoft.com/dotnet/fsharp/what-is-fsharp) -* [Get started with F#](https://docs.microsoft.com/dotnet/fsharp/get-started/) -* [F# Software Foundation](https://fsharp.org) -* [F# Testimonials](https://fsharp.org/testimonials) diff --git a/Restore.cmd b/Restore.cmd deleted file mode 100644 index 1b84815f3e..0000000000 --- a/Restore.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -restore %*" diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt deleted file mode 100644 index 2b54870d02..0000000000 --- a/RoslynPackageVersion.txt +++ /dev/null @@ -1 +0,0 @@ -3.2.0-beta4-19312-15 \ No newline at end of file diff --git a/Test.cmd b/Test.cmd deleted file mode 100644 index 4a6eabc39e..0000000000 --- a/Test.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -test %*" diff --git a/benchmarks/Benchmarks.sln b/benchmarks/Benchmarks.sln deleted file mode 100644 index 6b7bb5ac9f..0000000000 --- a/benchmarks/Benchmarks.sln +++ /dev/null @@ -1,62 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.136 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CompilerServiceBenchmarks", "CompilerServiceBenchmarks\CompilerServiceBenchmarks.fsproj", "{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "..\src\fsharp\FSharp.Core\FSharp.Core.fsproj", "{BB9EAE76-194A-49D8-9618-586CBE7031D9}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private", "..\src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{F57B02B1-CF26-4D93-9211-8CEB4F1572F0}" -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28407.52 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "CompilerServiceBenchmarks", "CompilerServiceBenchmarks\CompilerServiceBenchmarks.fsproj", "{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "..\src\fsharp\FSharp.Core\FSharp.Core.fsproj", "{DED3BBD7-53F4-428A-8C9F-27968E768605}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private", "..\src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Proto|Any CPU = Proto|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.Build.0 = Release|Any CPU - {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Release|Any CPU.Build.0 = Release|Any CPU - {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Release|Any CPU.Build.0 = Release|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Proto|Any CPU.Build.0 = Release|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.Build.0 = Release|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.Build.0 = Debug|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.Build.0 = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {049A4D02-709F-418C-AD59-7FB0DBE956B1} - EndGlobalSection -EndGlobal diff --git a/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj b/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj deleted file mode 100644 index 68f56def1d..0000000000 --- a/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - Exe - net472 - $(MSBuildProjectDirectory)\..\..\src - - - - Exe - net472 - true - true - $(SystemValueTupleVersion) - - - - AnyCPU - - - - - - - - - - - - - - - - - - - - - - diff --git a/benchmarks/CompilerServiceBenchmarks/Program.fs b/benchmarks/CompilerServiceBenchmarks/Program.fs deleted file mode 100644 index f13602445d..0000000000 --- a/benchmarks/CompilerServiceBenchmarks/Program.fs +++ /dev/null @@ -1,320 +0,0 @@ -open System -open System.IO -open System.Text -open FSharp.Compiler.ErrorLogger -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Text -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.AbstractIL.ILBinaryReader -open Microsoft.CodeAnalysis.Text -open BenchmarkDotNet.Attributes -open BenchmarkDotNet.Running - -module private SourceText = - - open System.Runtime.CompilerServices - - let weakTable = ConditionalWeakTable() - - let create (sourceText: SourceText) = - - let sourceText = - { new ISourceText with - - member __.Item with get index = sourceText.[index] - - member __.GetLineString(lineIndex) = - sourceText.Lines.[lineIndex].ToString() - - member __.GetLineCount() = - sourceText.Lines.Count - - member __.GetLastCharacterPosition() = - if sourceText.Lines.Count > 0 then - (sourceText.Lines.Count, sourceText.Lines.[sourceText.Lines.Count - 1].Span.Length) - else - (0, 0) - - member __.GetSubTextString(start, length) = - sourceText.GetSubText(TextSpan(start, length)).ToString() - - member __.SubTextEquals(target, startIndex) = - if startIndex < 0 || startIndex >= sourceText.Length then - raise (ArgumentOutOfRangeException("startIndex")) - - if String.IsNullOrEmpty(target) then - raise (ArgumentException("Target is null or empty.", "target")) - - let lastIndex = startIndex + target.Length - if lastIndex <= startIndex || lastIndex >= sourceText.Length then - raise (ArgumentException("Target is too big.", "target")) - - let mutable finished = false - let mutable didEqual = true - let mutable i = 0 - while not finished && i < target.Length do - if target.[i] <> sourceText.[startIndex + i] then - didEqual <- false - finished <- true // bail out early - else - i <- i + 1 - - didEqual - - member __.ContentEquals(sourceText) = - match sourceText with - | :? SourceText as sourceText -> sourceText.ContentEquals(sourceText) - | _ -> false - - member __.Length = sourceText.Length - - member __.CopyTo(sourceIndex, destination, destinationIndex, count) = - sourceText.CopyTo(sourceIndex, destination, destinationIndex, count) - } - - sourceText - -type SourceText with - - member this.ToFSharpSourceText() = - SourceText.weakTable.GetValue(this, Runtime.CompilerServices.ConditionalWeakTable<_,_>.CreateValueCallback(SourceText.create)) - -[] -module Helpers = - - let createProject name referencedProjects = - let tmpPath = Path.GetTempPath() - let file = Path.Combine(tmpPath, Path.ChangeExtension(name, ".fs")) - { - ProjectFileName = Path.Combine(tmpPath, Path.ChangeExtension(name, ".dll")) - ProjectId = None - SourceFiles = [|file|] - OtherOptions = - Array.append [|"--optimize+"; "--target:library" |] (referencedProjects |> Array.ofList |> Array.map (fun x -> "-r:" + x.ProjectFileName)) - ReferencedProjects = - referencedProjects - |> List.map (fun x -> (x.ProjectFileName, x)) - |> Array.ofList - IsIncompleteTypeCheckEnvironment = false - UseScriptResolutionRules = false - LoadTime = DateTime() - UnresolvedReferences = None - OriginalLoadReferences = [] - ExtraProjectInfo = None - Stamp = Some 0L (* set the stamp to 0L on each run so we don't evaluate the whole project again *) - } - - let generateSourceCode moduleName = - sprintf """ -module Benchmark.%s - -type %s = - - val X : int - - val Y : int - - val Z : int - -let function%s (x: %s) = - let x = 1 - let y = 2 - let z = x + y - z""" moduleName moduleName moduleName moduleName - -[] -type CompilerService() = - - let mutable checkerOpt = None - - let mutable sourceOpt = None - - let parsingOptions = - { - SourceFiles = [|"TypeChecker.fs"|] - ConditionalCompilationDefines = [] - ErrorSeverityOptions = FSharpErrorSeverityOptions.Default - IsInteractive = false - LightSyntax = None - CompilingFsLib = false - IsExe = false - } - - let mutable assembliesOpt = None - - let readerOptions = - { - pdbDirPath = None - reduceMemoryUsage = ReduceMemoryFlag.No - metadataOnly = MetadataOnlyFlag.Yes - tryGetMetadataSnapshot = fun _ -> None - } - - [] - member __.Setup() = - match checkerOpt with - | None -> checkerOpt <- Some(FSharpChecker.Create(projectCacheSize = 200)) - | _ -> () - - match sourceOpt with - | None -> - sourceOpt <- Some <| SourceText.From(File.OpenRead("""..\..\..\..\..\src\fsharp\TypeChecker.fs"""), Encoding.Default, SourceHashAlgorithm.Sha1, true) - | _ -> () - - match assembliesOpt with - | None -> - assembliesOpt <- - System.AppDomain.CurrentDomain.GetAssemblies() - |> Array.map (fun x -> (x.Location)) - |> Some - | _ -> () - - [] - member __.ParsingTypeCheckerFs() = - match checkerOpt, sourceOpt with - | None, _ -> failwith "no checker" - | _, None -> failwith "no source" - | Some(checker), Some(source) -> - let results = checker.ParseFile("TypeChecker.fs", source.ToFSharpSourceText(), parsingOptions) |> Async.RunSynchronously - if results.ParseHadErrors then failwithf "parse had errors: %A" results.Errors - - [] - member __.ParsingTypeCheckerFsSetup() = - match checkerOpt with - | None -> failwith "no checker" - | Some(checker) -> - checker.InvalidateAll() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - checker.ParseFile("dummy.fs", SourceText.ofString "dummy", parsingOptions) |> Async.RunSynchronously |> ignore - ClearAllILModuleReaderCache() - - [] - member __.ILReading() = - match assembliesOpt with - | None -> failwith "no assemblies" - | Some(assemblies) -> - // We try to read most of everything in the assembly that matter, mainly types with their properties, methods, and fields. - // CustomAttrs and SecurityDecls are lazy until you call them, so we call them here for benchmarking. - assemblies - |> Array.iter (fun (fileName) -> - let reader = OpenILModuleReader fileName readerOptions - - let ilModuleDef = reader.ILModuleDef - - let ilAssemblyManifest = ilModuleDef.Manifest.Value - - ilAssemblyManifest.CustomAttrs |> ignore - ilAssemblyManifest.SecurityDecls |> ignore - ilAssemblyManifest.ExportedTypes.AsList - |> List.iter (fun x -> - x.CustomAttrs |> ignore - ) - - ilModuleDef.CustomAttrs |> ignore - ilModuleDef.TypeDefs.AsArray - |> Array.iter (fun ilTypeDef -> - ilTypeDef.CustomAttrs |> ignore - ilTypeDef.SecurityDecls |> ignore - - ilTypeDef.Methods.AsArray - |> Array.iter (fun ilMethodDef -> - ilMethodDef.CustomAttrs |> ignore - ilMethodDef.SecurityDecls |> ignore - ) - - ilTypeDef.Fields.AsList - |> List.iter (fun ilFieldDef -> - ilFieldDef.CustomAttrs |> ignore - ) - - ilTypeDef.Properties.AsList - |> List.iter (fun ilPropertyDef -> - ilPropertyDef.CustomAttrs |> ignore - ) - ) - ) - - [] - member __.ILReadingSetup() = - // With caching, performance increases an order of magnitude when re-reading an ILModuleReader. - // Clear it for benchmarking. - ClearAllILModuleReaderCache() - - member val TypeCheckFileWith100ReferencedProjectsOptions = - createProject "MainProject" - [ for i = 1 to 100 do - yield - createProject ("ReferencedProject" + string i) [] - ] - - member this.TypeCheckFileWith100ReferencedProjectsRun() = - let options = this.TypeCheckFileWith100ReferencedProjectsOptions - let file = options.SourceFiles.[0] - - match checkerOpt with - | None -> failwith "no checker" - | Some checker -> - let parseResult, checkResult = - checker.ParseAndCheckFileInProject(file, 0, SourceText.ofString (File.ReadAllText(file)), options) - |> Async.RunSynchronously - - if parseResult.Errors.Length > 0 then - failwithf "%A" parseResult.Errors - - match checkResult with - | FSharpCheckFileAnswer.Aborted -> failwith "aborted" - | FSharpCheckFileAnswer.Succeeded checkFileResult -> - - if checkFileResult.Errors.Length > 0 then - failwithf "%A" checkFileResult.Errors - - [] - member this.TypeCheckFileWith100ReferencedProjectsSetup() = - this.TypeCheckFileWith100ReferencedProjectsOptions.SourceFiles - |> Seq.iter (fun file -> - File.WriteAllText(file, generateSourceCode (Path.GetFileNameWithoutExtension(file))) - ) - - this.TypeCheckFileWith100ReferencedProjectsOptions.ReferencedProjects - |> Seq.iter (fun (_, referencedProjectOptions) -> - referencedProjectOptions.SourceFiles - |> Seq.iter (fun file -> - File.WriteAllText(file, generateSourceCode (Path.GetFileNameWithoutExtension(file))) - ) - ) - - this.TypeCheckFileWith100ReferencedProjectsRun() - - [] - member this.TypeCheckFileWith100ReferencedProjects() = - // Because the checker's projectcachesize is set to 200, this should be fast. - // If set to 3, it will be almost as slow as re-evaluating all project and it's projects references on setup; this could be a bug or not what we want. - this.TypeCheckFileWith100ReferencedProjectsRun() - - [] - member this.TypeCheckFileWith100ReferencedProjectsCleanup() = - this.TypeCheckFileWith100ReferencedProjectsOptions.SourceFiles - |> Seq.iter (fun file -> - try File.Delete(file) with | _ -> () - ) - - this.TypeCheckFileWith100ReferencedProjectsOptions.ReferencedProjects - |> Seq.iter (fun (_, referencedProjectOptions) -> - referencedProjectOptions.SourceFiles - |> Seq.iter (fun file -> - try File.Delete(file) with | _ -> () - ) - ) - - match checkerOpt with - | None -> failwith "no checker" - | Some(checker) -> - checker.InvalidateAll() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - ClearAllILModuleReaderCache() - -[] -let main argv = - let _ = BenchmarkRunner.Run() - 0 diff --git a/clean.sh b/clean.sh deleted file mode 100755 index 4698bb1666..0000000000 --- a/clean.sh +++ /dev/null @@ -1,46 +0,0 @@ -#! /usr/bin/env bash - -DEAD_DIRS=( - "azure-pipelines.yml" - "DEVGUIDE.md" - "eng/common" - "eng/common/templates" - "eng/common/tools.ps1" - "FSharp.sln" - "setup/" - "src/fsharp/fsc/fsc.fsproj" - "src/fsharp/FSharp.Build" - "src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec" - "src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj" - "src/fsharp/fsi/xlf" - "src/fsharp/fsi/fsi.fsproj" - "src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj" - "src/fsharp/Interactive.DependencyManager/xlf" - "src/fsharp/Microsoft.DotNet.DependencyManager/xlf" - "src/fsharp/xlf" - "TESTGUIDE.md" - "tests/EndToEndBuildTests" - "tests/FSharp.Build.UnitTests" - "tests/FSharp.Compiler.ComponentTests" - "tests/FSharp.Compiler.Private.Scripting.UnitTests" - "tests/FSharp.Compiler.UnitTests" - "tests/FSharp.Core.UnitTests" - "tests/FSharp.Test.Utilities" - "tests/fsharp/*.fs" - "tests/fsharp/Compiler" - "tests/fsharp/conformance" - "tests/fsharp/core" - "tests/fsharp/FSharpSuite.Tests.fsproj" - "tests/fsharp/regression" - "tests/fsharp/SDKTests" - "tests/fsharp/test-framework.fs" - "tests/fsharp/tests.fs" - "tests/fsharp/typecheck" - "tests/fsharp/typeProviders" - "tests/fsharpqa" - "tests/scripts" - "VisualFSharp.sln" - "vsintegration" -) - -git rm -rf --ignore-unmatch ${DEAD_DIRS[*]} \ No newline at end of file diff --git a/docs/img/favicon.ico b/docs/img/favicon.ico new file mode 100644 index 0000000000..1b43557a9d Binary files /dev/null and b/docs/img/favicon.ico differ diff --git a/docs/img/logo.png b/docs/img/logo.png new file mode 100644 index 0000000000..f98449050b Binary files /dev/null and b/docs/img/logo.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000000..6277bee79f --- /dev/null +++ b/docs/index.md @@ -0,0 +1,29 @@ + +# F# Core Library Documentation + +This site contains the documentation for the FSharp.Compiler.Service library used in all F# code. + +FSharp.Compiler.Service contains functionality for basic F# definitions, operations for collections such as lists, maps and sequences, +and library functionality for quotations, reflections, events, asynchronous programming and native interoperability. + +The following namespaces are available: + +* [FSharp.Compiler.Service](reference/fsharp-core.html) - Basic definitions of options, functions, operators, results and formatting. + +* [FSharp.Collections](reference/fsharp-collections.html) - Operations for collections such as lists, arrays, sets, maps and sequences. See also [F# Collection Types](https://docs.microsoft.com/dotnet/fsharp/language-reference/fsharp-collection-types) in the F# Language Guide. + +* [FSharp.Control](reference/fsharp-control.html) - Library functionality for asynchronous programming, events and agents. See also [F# Asynchronous Programming](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/asynchronous-workflows) in the F# Language Guide. + +* [FSharp.Linq](reference/fsharp-linq.html) - Library functionality for F# query syntax and interoperability with .NET Expressions. See also [F# Query Expressions](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/query-expressions) in the F# Language Guide. + +* [FSharp.Quotations](reference/fsharp-quotations.html) - Library functionality for F# quotations. See also [F# Code Quotations](https://docs.microsoft.com/dotnet/fsharp/language-reference/code-quotations) in the F# Language Guide. + +* [FSharp.Reflection](reference/fsharp-reflection.html) - Library functionality for accessing additional information about F# types and F# values at runtime, augmenting that available through [System.Reflection](https://docs.microsoft.com/dotnet/api/system.reflection). See also [F# Reflection](https://en.wikibooks.org/wiki/F_Sharp_Programming/Reflection) in the F# Wiki Book. + +* [FSharp.NativeInterop](reference/fsharp-nativeinterop.html) - Basic functionality for native interopability. See also [F# External Functions](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/external-functions) in the F# Language Guide. + +* [FSharp.Compiler.Service.CompilerServices](reference/fsharp-core-compilerservices.html) - Library functionality for supporting type providers and code generated by the F# compiler. See also [F# Type Providers](https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/) in the F# Language Guide. + +## Contributing to this documentation + +To contribute to this documentation site and its content, please see [the notes in the corresponding GitHub repository](https://github.com/fsharp/fsharp-core-docs). diff --git a/dummyVersion.txt b/dummyVersion.txt new file mode 100644 index 0000000000..d6b24041cf --- /dev/null +++ b/dummyVersion.txt @@ -0,0 +1 @@ +19 diff --git a/eng/Build.ps1 b/eng/Build.ps1 deleted file mode 100644 index 630406eae9..0000000000 --- a/eng/Build.ps1 +++ /dev/null @@ -1,545 +0,0 @@ -# -# This script controls the F# build process. This encompasess everything from build, testing to -# publishing of NuGet packages. The intent is to structure it to allow for a simple flow of logic -# between the following phases: -# -# - restore -# - build -# - sign -# - pack -# - test -# - publish -# -# Each of these phases has a separate command which can be executed independently. For instance -# it's fine to call `build.ps1 -build -testDesktop` followed by repeated calls to -# `.\build.ps1 -testDesktop`. - -[CmdletBinding(PositionalBinding=$false)] -param ( - [string][Alias('c')]$configuration = "Debug", - [string][Alias('v')]$verbosity = "m", - [string]$msbuildEngine = "vs", - - # Actions - [switch][Alias('r')]$restore, - [switch]$noRestore, - [switch][Alias('b')]$build, - [switch]$rebuild, - [switch]$sign, - [switch]$noSign, - [switch]$pack, - [switch]$publish, - [switch]$launch, - [switch]$help, - - # Options - [switch][Alias('proto')]$bootstrap, - [string]$bootstrapConfiguration = "Proto", - [string]$bootstrapTfm = "net472", - [switch][Alias('bl')]$binaryLog, - [switch][Alias('nobl')]$excludeCIBinaryLog, - [switch]$ci, - [switch]$official, - [switch]$procdump, - [switch]$deployExtensions, - [switch]$prepareMachine, - [switch]$useGlobalNuGetCache = $true, - [switch]$warnAsError = $true, - [switch][Alias('test')]$testDesktop, - [switch]$testCoreClr, - [switch]$testCambridge, - [switch]$testCompiler, - [switch]$testFSharpCore, - [switch]$testFSharpQA, - [switch]$testScripting, - [switch]$testVs, - [switch]$testAll, - [string]$officialSkipTests = "false", - [switch]$noVisualStudio, - - [parameter(ValueFromRemainingArguments=$true)][string[]]$properties) - -Set-StrictMode -version 2.0 -$ErrorActionPreference = "Stop" -$BuildCategory = "" -$BuildMessage = "" - -function Print-Usage() { - Write-Host "Common settings:" - Write-Host " -configuration Build configuration: 'Debug' or 'Release' (short: -c)" - Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" - Write-Host " -deployExtensions Deploy built vsixes" - Write-Host " -binaryLog Create MSBuild binary log (short: -bl)" - Write-Host " -excludeCIBinaryLog When running on CI, allow no binary log (short: -nobl)" - Write-Host "" - Write-Host "Actions:" - Write-Host " -restore Restore packages (short: -r)" - Write-Host " -norestore Don't restore packages" - Write-Host " -build Build main solution (short: -b)" - Write-Host " -rebuild Rebuild main solution" - Write-Host " -pack Build NuGet packages, VS insertion manifests and installer" - Write-Host " -sign Sign our binaries" - Write-Host " -publish Publish build artifacts (e.g. symbols)" - Write-Host " -launch Launch Visual Studio in developer hive" - Write-Host " -help Print help and exit" - Write-Host "" - Write-Host "Test actions" - Write-Host " -testAll Run all tests" - Write-Host " -testCambridge Run Cambridge tests" - Write-Host " -testCompiler Run FSharpCompiler unit tests" - Write-Host " -testDesktop Run tests against full .NET Framework" - Write-Host " -testCoreClr Run tests against CoreCLR" - Write-Host " -testFSharpCore Run FSharpCore unit tests" - Write-Host " -testFSharpQA Run F# Cambridge tests" - Write-Host " -testScripting Run Scripting tests" - Write-Host " -testVs Run F# editor unit tests" - Write-Host " -officialSkipTests Set to 'true' to skip running tests" - Write-Host "" - Write-Host "Advanced settings:" - Write-Host " -ci Set when running on CI server" - Write-Host " -official Set when building an official build" - Write-Host " -bootstrap Build using a bootstrap compiler" - Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." - Write-Host " -procdump Monitor test runs with procdump" - Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" - Write-Host " -useGlobalNuGetCache Use global NuGet cache." - Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported." - Write-Host "" - Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." -} - -# Process the command line arguments and establish defaults for the values which are not -# specified. -function Process-Arguments() { - if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { - Print-Usage - exit 0 - } - $script:nodeReuse = $False; - - if ($testAll) { - $script:testDesktop = $True - $script:testCoreClr = $True - $script:testFSharpQA = $True - $script:testVs = $True - } - - if ([System.Boolean]::Parse($script:officialSkipTests)) { - $script:testAll = $False - $script:testCambridge = $False - $script:testCompiler = $False - $script:testDesktop = $False - $script:testCoreClr = $False - $script:testFSharpCore = $False - $script:testFSharpQA = $False - $script:testVs = $False - } - - if ($noRestore) { - $script:restore = $False; - } - - if ($noSign) { - $script:sign = $False; - } - - foreach ($property in $properties) { - if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { - Write-Host "Invalid argument: $property" - Print-Usage - exit 1 - } - } -} - -function Update-Arguments() { - if ($script:noVisualStudio) { - $script:bootstrapTfm = "netcoreapp3.1" - $script:msbuildEngine = "dotnet" - } - - if ($bootstrapTfm -eq "netcoreapp3.1") { - if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) { - $script:bootstrap = $True - } - } else { - if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.exe") -or (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) { - $script:bootstrap = $True - } - } -} - -function BuildSolution() { - # VisualFSharp.sln can't be built with dotnet due to WPF, WinForms and VSIX build task dependencies - $solution = "VisualFSharp.sln" - - Write-Host "$($solution):" - - if ($binaryLog -and $excludeCIBinaryLog) { - Write-Host "Invalid argument -binarylog(-bl) and -excludeCIBinaryLog(-nobl) cannot be set at the same time" - ExitWithExitCode 1 - } - $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } - - $projects = Join-Path $RepoRoot $solution - $officialBuildId = if ($official) { $env:BUILD_BUILDNUMBER } else { "" } - $toolsetBuildProj = InitializeToolset - $quietRestore = !$ci - $testTargetFrameworks = if ($testCoreClr) { "netcoreapp3.1" } else { "" } - - # Do not set the property to true explicitly, since that would override value projects might set. - $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } - - MSBuild $toolsetBuildProj ` - $bl ` - /p:Configuration=$configuration ` - /p:Projects=$projects ` - /p:RepoRoot=$RepoRoot ` - /p:Restore=$restore ` - /p:Build=$build ` - /p:Rebuild=$rebuild ` - /p:Pack=$pack ` - /p:Sign=$sign ` - /p:Publish=$publish ` - /p:ContinuousIntegrationBuild=$ci ` - /p:OfficialBuildId=$officialBuildId ` - /p:QuietRestore=$quietRestore ` - /p:QuietRestoreBinaryLog=$binaryLog ` - /p:TestTargetFrameworks=$testTargetFrameworks ` - /v:$verbosity ` - $suppressExtensionDeployment ` - @properties -} - -function TestAndAddToPath([string] $testPath) { - if (Test-Path $testPath) { - $env:PATH = "$testPath;$env:PATH" - Write-Host "Added [$testPath] to the path." - } -} - -function UpdatePath() { - # add highest framework dir - $subdir = "" - foreach ($child in Get-ChildItem "$env:WINDIR\Microsoft.NET\Framework\v4.0.?????") { - $subdir = $child - } - TestAndAddToPath $subdir - - # add windows SDK dir for ildasm.exe - foreach ($child in Get-ChildItem "${env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.* Tools") { - $subdir = $child - } - TestAndAddToPath $subdir - - TestAndAddToPath "$ArtifactsDir\bin\fsc\$configuration\net472" - TestAndAddToPath "$ArtifactsDir\bin\fsiAnyCpu\$configuration\net472" -} - -function VerifyAssemblyVersionsAndSymbols() { - $assemblyVerCheckPath = Join-Path $ArtifactsDir "Bootstrap\AssemblyCheck\AssemblyCheck.dll" - - # Only verify versions on CI or official build - if ($ci -or $official) { - $dotnetPath = InitializeDotNetCli - $dotnetExe = Join-Path $dotnetPath "dotnet.exe" - Exec-Console $dotnetExe """$assemblyVerCheckPath"" ""$ArtifactsDir""" - } -} - -function TestUsingNUnit([string] $testProject, [string] $targetFramework) { - $dotnetPath = InitializeDotNetCli - $dotnetExe = Join-Path $dotnetPath "dotnet.exe" - $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) - $testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml" - $testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog" - $args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path . --logger ""nunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" - - if (-not $noVisualStudio -or $norestore) { - $args += " --no-restore" - } - - if (-not $noVisualStudio) { - $args += " --no-build" - } - - if ($env:RunningAsPullRequest -ne "true") { - $args += " --filter TestCategory!=PullRequest" - } - - Exec-Console $dotnetExe $args -} - -function BuildCompiler() { - if ($bootstrapTfm -eq "netcoreapp3.1") { - $dotnetPath = InitializeDotNetCli - $dotnetExe = Join-Path $dotnetPath "dotnet.exe" - $fscProject = "$RepoRoot\src\fsharp\fsc\fsc.fsproj" - $fsiProject = "$RepoRoot\src\fsharp\fsi\fsi.fsproj" - - $argNoRestore = if ($norestore) { " --no-restore" } else { "" } - $argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" } - - if ($binaryLog) { - $logFilePath = Join-Path $LogDir "fscBootstrapLog.binlog" - $args += " /bl:$logFilePath" - } - $args = "build $fscProject -c $configuration -v $verbosity -f netcoreapp3.1" + $argNoRestore + $argNoIncremental - Exec-Console $dotnetExe $args - - if ($binaryLog) { - $logFilePath = Join-Path $LogDir "fsiBootstrapLog.binlog" - $args += " /bl:$logFilePath" - } - $args = "build $fsiProject -c $configuration -v $verbosity -f netcoreapp3.1" + $argNoRestore + $argNoIncremental - Exec-Console $dotnetExe $args - } -} - -function Prepare-TempDir() { - Copy-Item (Join-Path $RepoRoot "tests\Resources\Directory.Build.props") $TempDir - Copy-Item (Join-Path $RepoRoot "tests\Resources\Directory.Build.targets") $TempDir -} - -function DownloadDotnetFrameworkSdk() { - $dlTempPath = [System.IO.Path]::GetTempPath() - $dlRandomFile = [System.IO.Path]::GetRandomFileName() - $net48Dir = Join-Path $dlTempPath $dlRandomFile - Create-Directory $net48Dir - - $net48Exe = Join-Path $net48Dir "ndp48-devpack-enu.exe" - $dlLogFilePath = Join-Path $LogDir "dotnet48.install.log" - Invoke-WebRequest "https://go.microsoft.com/fwlink/?linkid=2088517" -OutFile $net48Exe - - Write-Host "Exec-Console $net48Exe /install /quiet /norestart /log $dlLogFilePath" - Exec-Console $net48Exe "/install /quiet /norestart /log $dlLogFilePath" -} - -function Test-IsAdmin { - ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") -} - -function TryDownloadDotnetFrameworkSdk() { - # If we are not running as admin user, don't bother grabbing ndp sdk -- since we don't need sn.exe - $isAdmin = Test-IsAdmin - Write-Host "TryDownloadDotnetFrameworkSdk -- Test-IsAdmin = '$isAdmin'" - if ($isAdmin -eq $true) - { - # Get program files(x86) location - if (${env:ProgramFiles(x86)} -eq $null) { - $programFiles = $env:ProgramFiles - } - else { - $programFiles = ${env:ProgramFiles(x86)} - } - - # Get windowsSDK location for x86 - $windowsSDK_ExecutablePath_x86 = $env:WindowsSDK_ExecutablePath_x86 - $newWindowsSDK_ExecutablePath_x86 = Join-Path "$programFiles" "Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" - - if ($windowsSDK_ExecutablePath_x86 -eq $null) { - $snPathX86 = Join-Path $newWindowsSDK_ExecutablePath_x86 "sn.exe" - } - else { - $snPathX86 = Join-Path $windowsSDK_ExecutablePath_x86 "sn.exe" - $snPathX86Exists = Test-Path $snPathX86 -PathType Leaf - if ($snPathX86Exists -ne $true) { - $windowsSDK_ExecutablePath_x86 = null - $snPathX86 = Join-Path $newWindowsSDK_ExecutablePath_x86 "sn.exe" - } - } - - $windowsSDK_ExecutablePath_x64 = $env:WindowsSDK_ExecutablePath_x64 - $newWindowsSDK_ExecutablePath_x64 = Join-Path "$programFiles" "Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64" - - if ($windowsSDK_ExecutablePath_x64 -eq $null) { - $snPathX64 = Join-Path $newWindowsSDK_ExecutablePath_x64 "sn.exe" - } - else { - $snPathX64 = Join-Path $windowsSDK_ExecutablePath_x64 "sn.exe" - $snPathX64Exists = Test-Path $snPathX64 -PathType Leaf - if ($snPathX64Exists -ne $true) { - $windowsSDK_ExecutablePath_x86 = null - $snPathX64 = Join-Path $newWindowsSDK_ExecutablePath_x64 "sn.exe" - } - } - - $snPathX86Exists = Test-Path $snPathX86 -PathType Leaf - Write-Host "pre-dl snPathX86Exists : $snPathX86Exists - '$snPathX86'" - if ($snPathX86Exists -ne $true) { - DownloadDotnetFrameworkSdk - } - - $snPathX86Exists = Test-Path $snPathX86 -PathType Leaf - if ($snPathX86Exists -eq $true) { - if ($windowsSDK_ExecutablePath_x86 -ne $newWindowsSDK_ExecutablePath_x86) { - $windowsSDK_ExecutablePath_x86 = $newWindowsSDK_ExecutablePath_x86 - # x86 environment variable - Write-Host "set WindowsSDK_ExecutablePath_x86=$WindowsSDK_ExecutablePath_x86" - [System.Environment]::SetEnvironmentVariable("WindowsSDK_ExecutablePath_x86","$newWindowsSDK_ExecutablePath_x86",[System.EnvironmentVariableTarget]::Machine) - $env:WindowsSDK_ExecutablePath_x86 = $newWindowsSDK_ExecutablePath_x86 - } - } - - # Also update environment variable for x64 - $snPathX64Exists = Test-Path $snPathX64 -PathType Leaf - if ($snPathX64Exists -eq $true) { - if ($windowsSDK_ExecutablePath_x64 -ne $newWindowsSDK_ExecutablePath_x64) { - $windowsSDK_ExecutablePath_x64 = $newWindowsSDK_ExecutablePath_x64 - # x64 environment variable - Write-Host "set WindowsSDK_ExecutablePath_x64=$WindowsSDK_ExecutablePath_x64" - [System.Environment]::SetEnvironmentVariable("WindowsSDK_ExecutablePath_x64","$newWindowsSDK_ExecutablePath_x64",[System.EnvironmentVariableTarget]::Machine) - $env:WindowsSDK_ExecutablePath_x64 = $newWindowsSDK_ExecutablePath_x64 - } - } - } -} - -function EnablePreviewSdks() { - if (Test-Path variable:global:_MSBuildExe) { - return - } - $vsInfo = LocateVisualStudio - if ($vsInfo -eq $null) { - # Preview SDKs are allowed when no Visual Studio instance is installed - return - } - - $vsId = $vsInfo.instanceId - $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] - - $instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId" - Create-Directory $instanceDir - $sdkFile = Join-Path $instanceDir "sdk.txt" - 'UsePreviews=True' | Set-Content $sdkFile -} - -try { - $script:BuildCategory = "Build" - $script:BuildMessage = "Failure preparing build" - - Process-Arguments - - . (Join-Path $PSScriptRoot "build-utils.ps1") - - Update-Arguments - - Push-Location $RepoRoot - - if ($ci) { - Prepare-TempDir - EnablePreviewSdks - } - - $buildTool = InitializeBuildTool - $toolsetBuildProj = InitializeToolset - TryDownloadDotnetFrameworkSdk - if ($bootstrap) { - $script:BuildMessage = "Failure building bootstrap compiler" - $bootstrapDir = Make-BootstrapBuild - } - - $script:BuildMessage = "Failure building product" - if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish) { - if ($noVisualStudio) { - BuildCompiler - } else { - BuildSolution - } - } - - if ($build) { - VerifyAssemblyVersionsAndSymbols - } - - $script:BuildCategory = "Test" - $script:BuildMessage = "Failure running tests" - $desktopTargetFramework = "net472" - $coreclrTargetFramework = "netcoreapp3.1" - - if ($testDesktop -and -not $noVisualStudio) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework - } - - if ($testCoreClr) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework - } - - if ($testFSharpQA -and -not $noVisualStudio) { - Push-Location "$RepoRoot\tests\fsharpqa\source" - $nugetPackages = Get-PackagesDir - $resultsRoot = "$ArtifactsDir\TestResults\$configuration" - $resultsLog = "test-net40-fsharpqa-results.log" - $errorLog = "test-net40-fsharpqa-errors.log" - $failLog = "test-net40-fsharpqa-errors" - $perlPackageRoot = "$nugetPackages\StrawberryPerl\5.28.0.1"; - $perlExe = "$perlPackageRoot\bin\perl.exe" - Create-Directory $resultsRoot - UpdatePath - $env:HOSTED_COMPILER = 1 - $env:CSC_PIPE = "$nugetPackages\Microsoft.Net.Compilers\2.7.0\tools\csc.exe" - $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\net472\FSharp.Core.dll" - $env:LINK_EXE = "$RepoRoot\tests\fsharpqa\testenv\bin\link\link.exe" - $env:OSARCH = $env:PROCESSOR_ARCHITECTURE - $env:PERL5LIB = "$perlPackageRoot\vendor\lib" - Exec-Console $perlExe """$RepoRoot\tests\fsharpqa\testenv\bin\runall.pl"" -resultsroot ""$resultsRoot"" -results $resultsLog -log $errorLog -fail $failLog -cleanup:no -procs:$env:NUMBER_OF_PROCESSORS" - Pop-Location - } - - if ($testFSharpCore) { - if (-not $noVisualStudio) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework - } - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - } - - if ($testCompiler) { - if (-not $noVisualStudio) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework - } - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - } - - if ($testCambridge) { - if (-not $noVisualStudio) { - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework - } - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework - } - - if ($testScripting) { - if (-not $noVisualStudio) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework - } - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework - } - - if ($testVs -and -not $noVisualStudio) { - TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\GetTypesVS.UnitTests\GetTypesVS.UnitTests.fsproj" -targetFramework $desktopTargetFramework - TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework - } - - ExitWithExitCode 0 -} -catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category $script:BuildCategory -Message $script:BuildMessage - ExitWithExitCode 1 -} -finally { - Pop-Location -} diff --git a/eng/CIBuild.cmd b/eng/CIBuild.cmd deleted file mode 100644 index 84640d7efc..0000000000 --- a/eng/CIBuild.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0\Build.ps1" -ci -restore -build -bootstrap -pack -sign -publish -binaryLog %* diff --git a/eng/DumpPackageRoot/DumpPackageRoot.csproj b/eng/DumpPackageRoot/DumpPackageRoot.csproj deleted file mode 100644 index c3b2cedf8f..0000000000 --- a/eng/DumpPackageRoot/DumpPackageRoot.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - netcoreapp3.1 - - - - - - - - - $(ArtifactsDir)NugetPackageRootContents - $(PackageRootArtifactDirectory)/package_contents.txt - - - - - diff --git a/eng/Signing.props b/eng/Signing.props deleted file mode 100644 index da17d32fa4..0000000000 --- a/eng/Signing.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml deleted file mode 100644 index 0d23aab716..0000000000 --- a/eng/Version.Details.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - https://github.com/dotnet/arcade - f6192d1e284a08ac05041d05fa6e60dec74b24f5 - - - diff --git a/eng/Versions.props b/eng/Versions.props deleted file mode 100644 index 8b4df92674..0000000000 --- a/eng/Versions.props +++ /dev/null @@ -1,193 +0,0 @@ - - - - false - - true - true - true - true - true - - - - beta - 5.0 - $(FSLanguageVersion) - $(FSCoreMajorVersion).0 - $(FSCoreMajorVersion).0 - $(FSCoreVersionPrefix).0 - - 4.7.2 - - $(FSCorePackageVersion)-$(PreReleaseVersionLabel).* - - - 11.0 - $(FSPackageMajorVersion).0 - $(FSPackageVersion) - $(FSPackageVersion).0 - - - 16 - 7 - $(VSMajorVersion).0 - $(VSMajorVersion).$(VSMinorVersion).0 - $(VSAssemblyVersionPrefix).0 - - - - $(FSCoreVersionPrefix) - $(FSCorePackageVersion) - $(FSProductVersionPrefix) - $(VSAssemblyVersionPrefix) - $(VersionPrefix).0 - - - - - - $(RestoreSources); - https://www.myget.org/F/fsharp-daily/api/v3/index.json; - https://dotnet.myget.org/F/roslyn-master-nightly/api/v3/index.json; - https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; - https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json; - https://api.nuget.org/v3/index.json; - https://dotnet.myget.org/F/roslyn/api/v3/index.json; - https://dotnet.myget.org/F/symreader-converter/api/v3/index.json; - https://dotnet.myget.org/F/interactive-window/api/v3/index.json; - https://myget.org/F/vs-devcore/api/v3/index.json; - https://myget.org/F/vs-editor/api/v3/index.json; - https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json; - https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json; - https://myget.org/F/roslyn_concord/api/v3/index.json; - - - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\RoslynPackageVersion.txt').Trim()) - - 1.5.0 - 4.3.0 - 4.3.0 - 4.0.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.5.3 - 4.3.0 - 4.3.0 - 4.3.0 - 1.6.0 - 4.3.0 - 1.5.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.11.0 - 4.3.0 - 4.3.0 - 4.5.0 - 4.5.0 - 4.5.3 - - $(RoslynVersion) - $(RoslynVersion) - $(RoslynVersion) - $(RoslynVersion) - $(RoslynVersion) - $(RoslynVersion) - 2.0.17 - $(RoslynVersion) - - 16.6 - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - - 8.0.1 - 14.0.25420 - 16.1.89 - 16.1.89 - 1.1.4322 - 16.1.89 - 16.1.89 - 16.0.28226-alpha - 16.1.28916.169 - 16.1.28917.181 - 16.1.89 - 16.1.89 - 16.1.89 - 8.0.50728 - 7.10.6071 - 16.1.28917.181 - 16.1.89 - 8.0.50728 - 16.0.201-pre-g7d366164d0 - 2.3.6152103 - 14.3.25407 - 16.1.28917.181 - 16.1.28917.181 - 16.1.28917.181 - 10.0.30319 - 11.0.50727 - 15.0.25123-Dev15Preview - 7.10.6072 - 8.0.50728 - 9.0.30730 - 10.0.30320 - 11.0.61031 - 12.0.30111 - 16.0.0 - 16.1.89 - 16.1.89 - 7.10.6071 - 8.0.50728 - 10.0.30320 - 12.0.30112 - 16.1.89 - 16.1.89 - 16.0.102 - 16.1.28917.181 - 15.3.58 - 9.0.30729 - 16.5.2044 - 12.0.4 - 7.0.4 - 8.0.4 - 11.0.4 - 7.0.4 - - 0.2.0 - 1.0.0 - 1.0.147 - - 3.0.0-alpha4 - 4.3.0.0 - 1.0.30 - 8.0.0-alpha - 2.7.0 - 3.1.0 - 3.0.0-preview-27318-01 - 3.0.0-preview-27318-01 - 16.6.1 - 4.3.0 - 9.0.1 - 3.11.0 - 3.11.2 - 3.11.0 - 2.1.41 - 1.0.0-beta2-dev3 - 5.28.0.1 - 2.0.187 - 2.4.1 - 5.10.3 - - diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 deleted file mode 100644 index dd812ea797..0000000000 --- a/eng/build-utils.ps1 +++ /dev/null @@ -1,274 +0,0 @@ -# Collection of powershell build utility functions that we use across our scripts. - -Set-StrictMode -version 2.0 -$ErrorActionPreference="Stop" - -# Import Arcade functions -. (Join-Path $PSScriptRoot "common\tools.ps1") - -$VSSetupDir = Join-Path $ArtifactsDir "VSSetup\$configuration" -$PackagesDir = Join-Path $ArtifactsDir "packages\$configuration" - -$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $false } -$nodeReuse = if (Test-Path variable:nodeReuse) { $nodeReuse } else { $false } -$bootstrapDir = if (Test-Path variable:bootstrapDir) { $bootstrapDir } else { "" } -$bootstrapConfiguration = if (Test-Path variable:bootstrapConfiguration) { $bootstrapConfiguration } else { "Proto" } -$bootstrapTfm = if (Test-Path variable:bootstrapTfm) { $bootstrapTfm } else { "net472" } -$properties = if (Test-Path variable:properties) { $properties } else { @() } - -function GetProjectOutputBinary([string]$fileName, [string]$projectName = "", [string]$configuration = $script:configuration, [string]$tfm = "net472", [string]$rid = "", [bool]$published = $false) { - $projectName = if ($projectName -ne "") { $projectName } else { [System.IO.Path]::GetFileNameWithoutExtension($fileName) } - $publishDir = if ($published) { "publish\" } else { "" } - $ridDir = if ($rid -ne "") { "$rid\" } else { "" } - return Join-Path $ArtifactsDir "bin\$projectName\$configuration\$tfm\$ridDir$publishDir$fileName" -} - -# Handy function for executing a command in powershell and throwing if it -# fails. -# -# Use this when the full command is known at script authoring time and -# doesn't require any dynamic argument build up. Example: -# -# Exec-Block { & $msbuild Test.proj } -# -# Original sample came from: http://jameskovacs.com/2010/02/25/the-exec-problem/ -function Exec-Block([scriptblock]$cmd) { - & $cmd - - # Need to check both of these cases for errors as they represent different items - # - $?: did the powershell script block throw an error - # - $lastexitcode: did a windows command executed by the script block end in error - if ((-not $?) -or ($lastexitcode -ne 0)) { - throw "Command failed to execute: $cmd" - } -} - -function Exec-CommandCore([string]$command, [string]$commandArgs, [switch]$useConsole = $true) { - if ($useConsole) { - $exitCode = Exec-Process $command $commandArgs - if ($exitCode -ne 0) { - throw "Command failed to execute with exit code $($exitCode): $command $commandArgs" - } - return - } - - $startInfo = New-Object System.Diagnostics.ProcessStartInfo - $startInfo.FileName = $command - $startInfo.Arguments = $commandArgs - - $startInfo.UseShellExecute = $false - $startInfo.WorkingDirectory = Get-Location - $startInfo.RedirectStandardOutput = $true - $startInfo.CreateNoWindow = $true - - $process = New-Object System.Diagnostics.Process - $process.StartInfo = $startInfo - $process.Start() | Out-Null - - $finished = $false - try { - # The OutputDataReceived event doesn't fire as events are sent by the - # process in powershell. Possibly due to subtlties of how Powershell - # manages the thread pool that I'm not aware of. Using blocking - # reading here as an alternative which is fine since this blocks - # on completion already. - $out = $process.StandardOutput - while (-not $out.EndOfStream) { - $line = $out.ReadLine() - Write-Output $line - } - - while (-not $process.WaitForExit(100)) { - # Non-blocking loop done to allow ctr-c interrupts - } - - $finished = $true - if ($process.ExitCode -ne 0) { - throw "Command failed to execute with exit code $($process.ExitCode): $command $commandArgs" - } - } - finally { - # If we didn't finish then an error occured or the user hit ctrl-c. Either - # way kill the process - if (-not $finished) { - $process.Kill() - } - } -} - -# Handy function for executing a windows command which needs to go through -# windows command line parsing. -# -# Use this when the command arguments are stored in a variable. Particularly -# when the variable needs reparsing by the windows command line. Example: -# -# $args = "/p:ManualBuild=true Test.proj" -# Exec-Command $msbuild $args -# -function Exec-Command([string]$command, [string]$commandArgs) { - Exec-CommandCore -command $command -commandArgs $commandargs -useConsole:$false -} - -# Functions exactly like Exec-Command but lets the process re-use the current -# console. This means items like colored output will function correctly. -# -# In general this command should be used in place of -# Exec-Command $msbuild $args | Out-Host -# -function Exec-Console([string]$command, [string]$commandArgs) { - Exec-CommandCore -command $command -commandArgs $commandargs -useConsole:$true -} - -# Handy function for executing a powershell script in a clean environment with -# arguments. Prefer this over & sourcing a script as it will both use a clean -# environment and do proper error checking -function Exec-Script([string]$script, [string]$scriptArgs = "") { - Exec-Command "powershell" "-noprofile -executionPolicy RemoteSigned -file `"$script`" $scriptArgs" -} - -# Ensure the proper .NET Core SDK is available. Returns the location to the dotnet.exe. -function Ensure-DotnetSdk() { - return Join-Path (InitializeDotNetCli -install:$true) "dotnet.exe" -} - -function Get-VersionCore([string]$name, [string]$versionFile) { - $name = $name.Replace(".", "") - $name = $name.Replace("-", "") - $nodeName = "$($name)Version" - $x = [xml](Get-Content -raw $versionFile) - $node = $x.SelectSingleNode("//Project/PropertyGroup/$nodeName") - if ($node -ne $null) { - return $node.InnerText - } - - throw "Cannot find package $name in $versionFile" - -} - -# Return the version of the NuGet package as used in this repo -function Get-PackageVersion([string]$name) { - return Get-VersionCore $name (Join-Path $EngRoot "Versions.props") -} - -# Locate the directory where our NuGet packages will be deployed. Needs to be kept in sync -# with the logic in Version.props -function Get-PackagesDir() { - $d = $null - if ($env:NUGET_PACKAGES -ne $null) { - $d = $env:NUGET_PACKAGES - } - else { - $d = Join-Path $env:UserProfile ".nuget\packages\" - } - - Create-Directory $d - return $d -} - -# Locate the directory of a specific NuGet package which is restored via our main -# toolset values. -function Get-PackageDir([string]$name, [string]$version = "") { - if ($version -eq "") { - $version = Get-PackageVersion $name - } - - $p = Get-PackagesDir - $p = Join-Path $p $name.ToLowerInvariant() - $p = Join-Path $p $version - return $p -} - -function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]$logFileName = "", [switch]$parallel = $true, [switch]$summary = $true, [switch]$warnAsError = $true, [string]$configuration = $script:configuration, [string]$verbosity = $script:verbosity) { - # Because we override the C#/VB toolset to build against our LKG package, it is important - # that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise, - # we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211. - # MSBuildAdditionalCommandLineArgs= - $args = "/p:TreatWarningsAsErrors=true /nologo /nodeReuse:false /p:Configuration=$configuration "; - - if ($warnAsError) { - $args += " /warnaserror" - } - - if ($summary) { - $args += " /consoleloggerparameters:Verbosity=minimal;summary" - } else { - $args += " /consoleloggerparameters:Verbosity=minimal" - } - - if ($parallel) { - $args += " /m" - } - - if ($binaryLog) { - if ($logFileName -eq "") { - $logFileName = [IO.Path]::GetFileNameWithoutExtension($projectFilePath) - } - $logFileName = [IO.Path]::ChangeExtension($logFileName, ".binlog") - $logFilePath = Join-Path $LogDir $logFileName - $args += " /bl:$logFilePath" - } - - if ($official) { - $args += " /p:OfficialBuildId=" + $env:BUILD_BUILDNUMBER - } - - if ($ci) { - $args += " /p:ContinuousIntegrationBuild=true" - } - - $args += " $buildArgs" - $args += " $projectFilePath" - $args += " $properties" - - $buildTool = InitializeBuildTool - Exec-Console $buildTool.Path "$($buildTool.Command) $args" -} - -# Create a bootstrap build of the compiler. Returns the directory where the bootstrap build -# is located. -# -# Important to not set $script:bootstrapDir here yet as we're actually in the process of -# building the bootstrap. -function Make-BootstrapBuild() { - Write-Host "Building bootstrap '$bootstrapTfm' compiler" - - $dir = Join-Path $ArtifactsDir "Bootstrap" - Remove-Item -re $dir -ErrorAction SilentlyContinue - Create-Directory $dir - - # prepare FsLex and Fsyacc and AssemblyCheck - $dotnetPath = InitializeDotNetCli - $dotnetExe = Join-Path $dotnetPath "dotnet.exe" - $buildToolsProject = "$RepoRoot\src\buildtools\buildtools.proj" - - $argNoRestore = if ($norestore) { " --no-restore" } else { "" } - $argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" } - - $args = "build $buildToolsProject -c $bootstrapConfiguration -v $verbosity -f netcoreapp3.1" + $argNoRestore + $argNoIncremental - if ($binaryLog) { - $logFilePath = Join-Path $LogDir "toolsBootstrapLog.binlog" - $args += " /bl:$logFilePath" - } - Exec-Console $dotnetExe $args - - Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp3.1" -Destination "$dir\fslex" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp3.1" -Destination "$dir\fsyacc" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\netcoreapp3.1" -Destination "$dir\AssemblyCheck" -Force -Recurse - - # prepare compiler - $protoProject = "$RepoRoot\proto.proj" - $args = "build $protoProject -c $bootstrapConfiguration -v $verbosity -f $bootstrapTfm" + $argNoRestore + $argNoIncremental - if ($binaryLog) { - $logFilePath = Join-Path $LogDir "protoBootstrapLog.binlog" - $args += " /bl:$logFilePath" - } - Exec-Console $dotnetExe $args - - Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsc" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm" -Destination "$dir\fsi" -Force -Recurse - - return $dir -} - - - diff --git a/eng/build.sh b/eng/build.sh deleted file mode 100755 index 5ec449d1cc..0000000000 --- a/eng/build.sh +++ /dev/null @@ -1,304 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. - -# Stop script if unbound variable found (use ${var:-} if intentional) -set -u - -usage() -{ - echo "Common settings:" - echo " --configuration Build configuration: 'Debug' or 'Release' (short: -c)" - echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" - echo " --binaryLog Create MSBuild binary log (short: -bl)" - echo "" - echo "Actions:" - echo " --bootstrap Force the build of the bootstrap compiler" - echo " --restore Restore projects required to build (short: -r)" - echo " --norestore Don't restore projects required to build" - echo " --build Build all projects (short: -b)" - echo " --rebuild Rebuild all projects" - echo " --pack Build nuget packages" - echo " --publish Publish build artifacts" - echo " --help Print help and exit" - echo "" - echo "Test actions:" - echo " --testcoreclr Run unit tests on .NET Core (short: --test, -t)" - echo "" - echo "Advanced settings:" - echo " --ci Building in CI" - echo " --docker Run in a docker container if applicable" - echo " --skipAnalyzers Do not run analyzers during build operations" - echo " --prepareMachine Prepare machine for CI run, clean up processes after build" - echo "" - echo "Command line arguments starting with '/p:' are passed through to MSBuild." -} - -source="${BASH_SOURCE[0]}" - -# resolve $source until the file is no longer a symlink -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -restore=false -build=false -rebuild=false -pack=false -publish=false -test_core_clr=false - -configuration="Debug" -verbosity='minimal' -binary_log=false -force_bootstrap=false -ci=false -skip_analyzers=false -prepare_machine=false -source_build=false -properties="" - -docker=false -args="" - -BuildCategory="" -BuildMessage="" - -if [[ $# = 0 ]] -then - usage - exit 1 -fi - -while [[ $# > 0 ]]; do - opt="$(echo "$1" | awk '{print tolower($0)}')" - case "$opt" in - --help|-h) - usage - exit 0 - ;; - --configuration|-c) - configuration=$2 - args="$args $1" - shift - ;; - --verbosity|-v) - verbosity=$2 - args="$args $1" - shift - ;; - --binarylog|-bl) - binary_log=true - ;; - --bootstrap) - force_bootstrap=true - ;; - --restore|-r) - restore=true - ;; - --norestore) - restore=false - ;; - --build|-b) - build=true - ;; - --rebuild) - rebuild=true - ;; - --pack) - pack=true - ;; - --publish) - publish=true - ;; - --testcoreclr|--test|-t) - test_core_clr=true - ;; - --ci) - ci=true - ;; - --skipanalyzers) - skip_analyzers=true - ;; - --preparemachine) - prepare_machine=true - ;; - --docker) - docker=true - shift - continue - ;; - /p:*) - properties="$properties $1" - if [[ "$1" == "/p:dotnetbuildfromsource=true" ]]; then - source_build=true - fi - ;; - *) - echo "Invalid argument: $1" - usage - exit 1 - ;; - esac - args="$args $1" - shift -done - -# Import Arcade functions -. "$scriptroot/common/tools.sh" - -function TestUsingNUnit() { - BuildCategory="Test" - BuildMessage="Error running tests" - testproject="" - targetframework="" - while [[ $# > 0 ]]; do - opt="$(echo "$1" | awk '{print tolower($0)}')" - case "$opt" in - --testproject) - testproject=$2 - shift - ;; - --targetframework) - targetframework=$2 - shift - ;; - *) - echo "Invalid argument: $1" - exit 1 - ;; - esac - shift - done - - if [[ "$testproject" == "" || "$targetframework" == "" ]]; then - echo "--testproject and --targetframework must be specified" - exit 1 - fi - - filterArgs="" - if [[ "${RunningAsPullRequest:-}" != "true" ]]; then - filterArgs=" --filter TestCategory!=PullRequest" - fi - - projectname=$(basename -- "$testproject") - projectname="${projectname%.*}" - testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" - args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"$filterArgs" - "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? -} - -function BuildSolution { - BuildCategory="Build" - BuildMessage="Error preparing build" - local solution="FSharp.sln" - echo "$solution:" - - InitializeToolset - local toolset_build_proj=$_InitializeToolset - - local bl="" - if [[ "$binary_log" = true ]]; then - bl="/bl:\"$log_dir/Build.binlog\"" - fi - - local projects="$repo_root/$solution" - - # https://github.com/dotnet/roslyn/issues/23736 - local enable_analyzers=!$skip_analyzers - UNAME="$(uname)" - if [[ "$UNAME" == "Darwin" ]]; then - enable_analyzers=false - fi - - # NuGet often exceeds the limit of open files on Mac and Linux - # https://github.com/NuGet/Home/issues/2163 - if [[ "$UNAME" == "Darwin" || "$UNAME" == "Linux" ]]; then - ulimit -n 6500 - fi - - local quiet_restore="" - if [[ "$ci" != true ]]; then - quiet_restore=true - fi - - # Node reuse fails because multiple different versions of FSharp.Build.dll get loaded into MSBuild nodes - node_reuse=false - - # build bootstrap tools - bootstrap_config=Proto - bootstrap_dir=$artifacts_dir/Bootstrap - if [[ "$force_bootstrap" == true ]]; then - rm -fr $bootstrap_dir - fi - if [ ! -f "$bootstrap_dir/fslex.dll" ]; then - BuildMessage="Error building tools" - MSBuild "$repo_root/src/buildtools/buildtools.proj" \ - /restore \ - /p:Configuration=$bootstrap_config \ - /t:Publish - - mkdir -p "$bootstrap_dir" - cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp3.1/publish $bootstrap_dir/fslex - cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp3.1/publish $bootstrap_dir/fsyacc - fi - if [ ! -f "$bootstrap_dir/fsc.exe" ]; then - BuildMessage="Error building bootstrap" - MSBuild "$repo_root/proto.proj" \ - /restore \ - /p:Configuration=$bootstrap_config \ - /t:Publish - - cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp3.1/publish $bootstrap_dir/fsc - fi - - # do real build - BuildMessage="Error building solution" - MSBuild $toolset_build_proj \ - $bl \ - /v:$verbosity \ - /p:Configuration=$configuration \ - /p:Projects="$projects" \ - /p:RepoRoot="$repo_root" \ - /p:Restore=$restore \ - /p:Build=$build \ - /p:Rebuild=$rebuild \ - /p:Pack=$pack \ - /p:Publish=$publish \ - /p:UseRoslynAnalyzers=$enable_analyzers \ - /p:ContinuousIntegrationBuild=$ci \ - /p:QuietRestore=$quiet_restore \ - /p:QuietRestoreBinaryLog="$binary_log" \ - $properties -} - -function TrapAndReportError { - local exit_code=$? - if [[ ! $exit_code == 0 ]]; then - Write-PipelineTelemetryError -category $BuildCategory "$BuildMessage (exit code '$exit_code')." - ExitWithExitCode $exit_code - fi -} - -# allow early termination to report the appropriate build failure reason -trap TrapAndReportError EXIT - -InitializeDotNetCli $restore - -BuildSolution - -if [[ "$test_core_clr" == true ]]; then - coreclrtestframework=netcoreapp3.1 - TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework - TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework - TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework - TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework - TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework -fi - -ExitWithExitCode 0 diff --git a/eng/cibuild.sh b/eng/cibuild.sh deleted file mode 100755 index 290f7ebaa5..0000000000 --- a/eng/cibuild.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" - -# resolve $SOURCE until the file is no longer a symlink -while [[ -h $source ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - - # if $source was a relative symlink, we need to resolve it relative to the path where - # the symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd)" - -echo "Building this commit:" -git show --no-patch --pretty=raw HEAD - -. "$scriptroot/build.sh" --ci --restore --build --pack --publish --binaryLog "$@" diff --git a/eng/config/runtimeconfig.template.json b/eng/config/runtimeconfig.template.json deleted file mode 100644 index a3075303ad..0000000000 --- a/eng/config/runtimeconfig.template.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "rollForwardOnNoCandidateFx": 2 -} diff --git a/eng/release/insert-into-vs.yml b/eng/release/insert-into-vs.yml deleted file mode 100644 index ad19e31d09..0000000000 --- a/eng/release/insert-into-vs.yml +++ /dev/null @@ -1,56 +0,0 @@ -parameters: - componentBranchName: '' - insertBuildPolicy: 'Request Perf DDRITs' - insertTargetBranch: '' - insertTeamEmail: '' - insertTeamName: '' - dependsOn: [build] - -stages: -- stage: insert - dependsOn: build - displayName: Insert into VS - jobs: - - job: Insert_VS - pool: - vmImage: vs2017-win2016 - variables: - - group: DotNet-VSTS-Infra-Access - - name: InsertAccessToken - value: $(dn-bot-devdiv-build-rw-code-rw-release-rw) - - name: InsertBuildPolicy - value: ${{ parameters.insertBuildPolicy }} - - name: InsertTargetBranch - value: ${{ parameters.insertTargetBranch }} - - name: InsertTeamEmail - value: ${{ parameters.insertTeamEmail }} - - name: InsertTeamName - value: ${{ parameters.insertTeamName }} - - name: InsertPayloadName - value: '${{ parameters.insertTeamName }} $(Build.SourceBranchName) $(Build.BuildNumber)' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Insertion Artifacts - inputs: - buildType: current - artifactName: VSSetup - - task: PowerShell@2 - displayName: Get Publish URLs - inputs: - filePath: $(Build.SourcesDirectory)/eng/release/scripts/GetPublishUrls.ps1 - arguments: -accessToken $(System.AccessToken) -buildId $(Build.BuildId) -insertionDir $(Build.ArtifactStagingDirectory)\VSSetup - - task: PowerShell@2 - displayName: Get versions for default.config - inputs: - filePath: $(Build.SourcesDirectory)/eng/release/scripts/GetDefaultConfigVersions.ps1 - arguments: -packagesDir $(Build.ArtifactStagingDirectory)\VSSetup\DevDivPackages - - task: PowerShell@2 - displayName: Get versions for AssemblyVersions.tt - inputs: - filePath: $(Build.SourcesDirectory)/eng/release/scripts/GetAssemblyVersions.ps1 - arguments: -assemblyVersionsPath $(Build.ArtifactStagingDirectory)\VSSetup\DevDivPackages\DependentAssemblyVersions.csv - - task: ms-vseng.MicroBuildShipTasks.55100717-a81d-45ea-a363-b8fe3ec375ad.MicroBuildInsertVsPayload@3 - displayName: 'Insert VS Payload' - inputs: - LinkWorkItemsToPR: false - condition: and(succeeded(), eq(variables['Build.SourceBranch'], '${{ parameters.componentBranchName }}')) diff --git a/eng/release/scripts/GetAssemblyVersions.ps1 b/eng/release/scripts/GetAssemblyVersions.ps1 deleted file mode 100644 index 2b75ac1dd5..0000000000 --- a/eng/release/scripts/GetAssemblyVersions.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -param ( - [string]$assemblyVersionsPath -) - -Set-StrictMode -version 2.0 -$ErrorActionPreference = "Stop" - -try { - [string[]]$lines = Get-Content -Path $assemblyVersionsPath | ForEach-Object { - $parts = $_ -Split ",",2 - $asm = $parts[0] - $ver = $parts[1] - $asmConst = ($asm -Replace "\.","") + "Version" - $output = "$asmConst=$ver" - $output - } - - $final = $lines -Join "," - Write-Host "Setting InsertVersionsValues to $final" - Write-Host "##vso[task.setvariable variable=InsertVersionsValues]$final" -} -catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 -} diff --git a/eng/release/scripts/GetDefaultConfigVersions.ps1 b/eng/release/scripts/GetDefaultConfigVersions.ps1 deleted file mode 100644 index d0f1f67fc5..0000000000 --- a/eng/release/scripts/GetDefaultConfigVersions.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -param ( - [string]$packagesDir -) - -Set-StrictMode -version 2.0 -$ErrorActionPreference = "Stop" - -try { - $packages = @() - $regex = "^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z0-9]+)?)\.nupkg$" - Get-Item -Path "$packagesDir\*" -Filter "*.nupkg" | ForEach-Object { - $fileName = Split-Path $_ -Leaf - If ($fileName -Match $regex) { - $entry = $Matches[1] + "=" + $Matches[2] - $packages += $entry - } - } - - $final = $packages -Join "," - Write-Host "Setting InsertConfigValues to $final" - Write-Host "##vso[task.setvariable variable=InsertConfigValues]$final" -} -catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 -} diff --git a/eng/release/scripts/GetPublishUrls.ps1 b/eng/release/scripts/GetPublishUrls.ps1 deleted file mode 100644 index 897ef398f5..0000000000 --- a/eng/release/scripts/GetPublishUrls.ps1 +++ /dev/null @@ -1,123 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -param ( - [string]$accessToken, - [string]$buildId, - [string]$insertionDir -) - -Set-StrictMode -version 2.0 -$ErrorActionPreference = "Stop" - -$dropUrlRegex = "(https://vsdrop\.corp\.microsoft\.com/[^\r\n;]+);([^\r\n]+)\r?\n" - -function Invoke-WebRequestWithAccessToken([string] $uri, [string] $accessToken, [int] $retryCount = 5) { - Write-Host "Fetching content from $uri" - $base64 = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$accessToken")) - $headers = @{ - Authorization = "Basic $base64" - } - - for ($i = 0; $i -lt $retryCount; $i++) { - try { - return Invoke-WebRequest -Method Get -Uri $uri -Headers $headers -UseBasicParsing - } - catch { - Write-Host "Invoke-WebRequest failed: $_" - Start-Sleep -Seconds 1 - } - } - - throw "Unable to fetch $uri after $retryCount tries." -} - -# this function has to download ~500 individual logs and check each one; prone to timeouts -function Get-ManifestsViaIndividualLogs([PSObject] $manifestVersionMap, [string] $buildId, [string] $accessToken) { - $manifests = @() - $seenManifests = @{} - $json = Invoke-WebRequestWithAccessToken -uri "https://dev.azure.com/dnceng/internal/_apis/build/builds/$buildId/logs?api-version=5.1" -accessToken $accessToken | ConvertFrom-Json - foreach ($l in $json.value) { - $logUrl = $l.url - $log = (Invoke-WebRequestWithAccessToken -uri $logUrl -accessToken $accessToken).Content - If ($log -Match $dropUrlRegex) { - $manifestShortUrl = $Matches[1] - $manifestName = $Matches[2] - $manifestUrl = "$manifestShortUrl;$manifestName" - If (-Not $seenManifests.Contains($manifestUrl)) { - $seenManifests.Add($manifestUrl, $true) - $buildVersion = $manifestVersionMap[$manifestName] - $manifestEntry = "$manifestName{$buildVersion}=$manifestUrl" - $manifests += $manifestEntry - } - } - } - - return $manifests -} - -# this function only has to download 1 file and look at a very specific file -function Get-ManifestsViaZipLog([PSObject] $manifestVersionMap, [string] $buildId, [string] $accessToken) { - # create temporary location - $guid = [System.Guid]::NewGuid().ToString() - $tempDir = Join-Path ([System.IO.Path]::GetTempPath()) $guid - New-Item -ItemType Directory -Path $tempDir | Out-Null - - # download the logs - $base64 = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$accessToken")) - $headers = @{ - Authorization = "Basic $base64" - } - $uri = "https://dev.azure.com/dnceng/internal/_apis/build/builds/$buildId/logs?`$format=zip" - Invoke-WebRequest -Uri $uri -Method Get -Headers $headers -UseBasicParsing -OutFile "$tempDir/logs.zip" - - # expand the logs - New-Item -ItemType Directory -Path "$tempDir/logs" | Out-Null - Expand-Archive -Path "$tempDir/logs.zip" -DestinationPath "$tempDir/logs" - - # parse specific logs - $logDir = "$tempDir/logs" - $manifests = @() - $seenManifests = @{} - Get-ChildItem $logDir -r -inc "*Upload VSTS Drop*" | ForEach-Object { - $result = Select-String -Path $_ -Pattern "(https://vsdrop\.corp\.microsoft\.com[^;]+);(.*)" -AllMatches - $result.Matches | ForEach-Object { - $manifestShortUrl = $_.Groups[1].Value - $manifestName = $_.Groups[2].Value - $manifestUrl = "$manifestShortUrl;$manifestName" - If (-Not $seenManifests.Contains($manifestUrl)) { - $seenManifests.Add($manifestUrl, $true) - $buildVersion = $manifestVersionMap[$manifestName] - $manifestEntry = "$manifestName{$buildVersion}=$manifestUrl" - $manifests += $manifestEntry - } - } - } - - Remove-Item -Path $tempDir -Recurse - - return $manifests -} - -try { - # build map of all *.vsman files to their `info.buildVersion` values - $manifestVersionMap = @{} - Get-ChildItem -Path "$insertionDir\*" -Filter "*.vsman" | ForEach-Object { - $manifestName = Split-Path $_ -Leaf - $vsmanContents = Get-Content $_ | ConvertFrom-Json - $buildVersion = $vsmanContents.info.buildVersion - $manifestVersionMap.Add($manifestName, $buildVersion) - } - - # find all publish URLs - #$manifests = Get-ManifestsViaIndividualLogs -manifestVersionMap $manifestVersionMap -buildId $buildId -accessToken $accessToken - $manifests = Get-ManifestsViaZipLog -manifestVersionMap $manifestVersionMap -buildId $buildId -accessToken $accessToken - - $final = $manifests -Join "," - Write-Host "Setting InsertJsonValues to $final" - Write-Host "##vso[task.setvariable variable=InsertJsonValues]$final" -} -catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 -} diff --git a/eng/targets/Imports.targets b/eng/targets/Imports.targets deleted file mode 100644 index c13c86875d..0000000000 --- a/eng/targets/Imports.targets +++ /dev/null @@ -1,9 +0,0 @@ - - - - $(RepositoryEngineeringDir)config\runtimeconfig.template.json - - diff --git a/eng/targets/NGenBinaries.targets b/eng/targets/NGenBinaries.targets deleted file mode 100644 index c06944e270..0000000000 --- a/eng/targets/NGenBinaries.targets +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - false - true - - - - - - - true - false - - - - - - - $(windir)\Microsoft.NET\Framework\v4.0.30319\ngen.exe - $(windir)\Microsoft.NET\Framework64\v4.0.30319\ngen.exe - - - - - - - - - - - - - - - - $(WindowsSDK_ExecutablePath_x86)\sn.exe - $(WindowsSDK_ExecutablePath_x64)\sn.exe - - - - - - - diff --git a/eng/targets/NuGet.targets b/eng/targets/NuGet.targets deleted file mode 100644 index dc8f32e24d..0000000000 --- a/eng/targets/NuGet.targets +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props deleted file mode 100644 index 77f7a0c704..0000000000 --- a/eng/targets/Settings.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - MIT - Visual F# Compiler FSharp functional programming - $(ArtifactsBinDir) - - - - - false - - - diff --git a/eng/tests/UpToDate.ps1 b/eng/tests/UpToDate.ps1 deleted file mode 100644 index e29bb9d878..0000000000 --- a/eng/tests/UpToDate.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -# This script verifies that subsequent calls to `Build.cmd` don't cause assemblies to be unnecessarily rebuilt. - -[CmdletBinding(PositionalBinding=$false)] -param ( - [string][Alias('c')]$configuration = "Debug", - [parameter(ValueFromRemainingArguments=$true)][string[]]$properties -) - -Set-StrictMode -version 2.0 -$ErrorActionPreference = "Stop" - -try { - $RepoRoot = Join-Path $PSScriptRoot ".." | Join-Path -ChildPath ".." -Resolve - $BuildScript = Join-Path $RepoRoot "Build.cmd" - - # do first build - & $BuildScript -configuration $configuration @properties - if ($LASTEXITCODE -ne 0) { - Write-Host "Error running first build." - exit 1 - } - - # gather assembly timestamps - $ArtifactsBinDir = Join-Path $RepoRoot "artifacts" | Join-Path -ChildPath "bin" -Resolve - $FSharpAssemblyDirs = Get-ChildItem -Path $ArtifactsBinDir -Filter "FSharp.*" - $FscAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fsc" - $FsiAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fsi" - $FsiAnyCpuAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fsiAnyCpu" - $DmAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "Microsoft.DotNet.DependencyManager" - $ProjectSystemAssemblyDirs = Get-ChildItem -Path $ArtifactsBinDir -Filter "ProjectSystem*" - $FSharpDirs = @($FSharpAssemblyDirs) + @($FscAssemblyDir) + @($FsiAssemblyDir) + @($FsiAnyCpuAssemblyDir) + @($DmAssemblyDir) + @($ProjectSystemAssemblyDirs) - $FSharpDllPaths = $FSharpDirs | ForEach-Object { Get-ChildItem -Path (Join-Path $ArtifactsBinDir $_) -Recurse -Filter "*.dll" } | ForEach-Object { $_.FullName } - $FSharpExePaths = $FSharpDirs | ForEach-Object { Get-ChildItem -Path (Join-Path $ArtifactsBinDir $_) -Recurse -Filter "*.exe" } | ForEach-Object { $_.FullName } - $FSharpAssemblyPaths = @($FSharpDllPaths) + @($FSharpExePaths) - - $InitialAssembliesAndTimes = @{} - foreach ($asm in $FSharpAssemblyPaths) { - Write-Host "Assembly : $asm" - $LastWriteTime = (Get-Item $asm).LastWriteTimeUtc - $InitialAssembliesAndTimes.Add($asm, $LastWriteTime) - } - - $InitialCompiledCount = $FSharpAssemblyPaths.Length - - # build again - & $BuildScript -configuration $configuration @properties - if ($LASTEXITCODE -ne 0) { - Write-Host "Error running second build." - exit 1 - } - - # gather assembly timestamps again - $FinalAssembliesAndTimes = @{} - foreach ($asm in $FSharpAssemblyPaths) { - $LastWriteTime = (Get-Item $asm).LastWriteTimeUtc - $FinalAssembliesAndTimes.Add($asm, $LastWriteTime) - } - - # validate that assembly timestamps haven't changed - $RecompiledFiles = @() - foreach ($asm in $InitialAssembliesAndTimes.keys) { - $InitialTime = $InitialAssembliesAndTimes[$asm] - $FinalTime = $FinalAssembliesAndTimes[$asm] - if ($InitialTime -ne $FinalTime) { - Write-Host "Rebuilt assembly: $asm" - $RecompiledFiles += $asm - } - } - - $RecompiledCount = $RecompiledFiles.Length - Write-Host "$RecompiledCount of $InitialCompiledCount assemblies were re-compiled" - $RecompiledFiles | ForEach-Object { Write-Host " $_" } - exit $RecompiledCount -} -catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 -} diff --git a/fcs/.config/dotnet-tools.json b/fcs/.config/dotnet-tools.json deleted file mode 100644 index 921015529f..0000000000 --- a/fcs/.config/dotnet-tools.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "fake-cli": { - "version": "5.18.3", - "commands": [ - "fake" - ] - }, - "paket": { - "version": "5.236.0", - "commands": [ - "paket" - ] - }, - "fornax": { - "version": "0.13.1", - "commands": [ - "fornax" - ] - } - } -} \ No newline at end of file diff --git a/fcs/.gitignore b/fcs/.gitignore deleted file mode 100644 index 0a3b52abf5..0000000000 --- a/fcs/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -.paket/ -build.fsx.lock -FSharp.Compiler.Service.Tests/TestResults/* -FSharp.Compiler.Service.netstandard/illex.fs -FSharp.Compiler.Service.netstandard/ilpars.fs -FSharp.Compiler.Service.netstandard/ilpars.fsi -FSharp.Compiler.Service.netstandard/lex.fs -FSharp.Compiler.Service.netstandard/pars.fs -FSharp.Compiler.Service.netstandard/pars.fsi -FSharp.Compiler.Service.netstandard/pplex.fs -FSharp.Compiler.Service.netstandard/pppars.fs -FSharp.Compiler.Service.netstandard/pppars.fsi -.idea/ -_public \ No newline at end of file diff --git a/fcs/.paket/Paket.Restore.targets b/fcs/.paket/Paket.Restore.targets deleted file mode 100644 index a79555813d..0000000000 --- a/fcs/.paket/Paket.Restore.targets +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - $(MSBuildVersion) - 15.0.0 - false - true - - true - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)..\ - $(PaketRootPath)paket-files\paket.restore.cached - $(PaketRootPath)paket.lock - classic - proj - assembly - native - /Library/Frameworks/Mono.framework/Commands/mono - mono - - - $(PaketRootPath)paket.bootstrapper.exe - $(PaketToolsPath)paket.bootstrapper.exe - $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\ - - "$(PaketBootStrapperExePath)" - $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)" - - - - - true - true - - - True - - $(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/')) - - - - - - - - - - - - - dotnet paket - - - - - - $(PaketRootPath)paket.exe - $(PaketToolsPath)paket.exe - $(PaketToolsPath)paket.exe - $(_PaketBootStrapperExeDir)paket.exe - paket.exe - - - $(PaketRootPath)paket - $(PaketToolsPath)paket - $(PaketToolsPath)paket - - - $(PaketRootPath)paket.exe - $(PaketToolsPath)paket.exe - - - $(PaketBootStrapperExeDir)paket.exe - - - paket - - <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)")) - dotnet "$(PaketExePath)" - $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" - "$(PaketExePath)" - - - - - - - - - - - - - - - - - - - - - - true - $(NoWarn);NU1603;NU1604;NU1605;NU1608 - false - true - - - - - - - - - $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) - - - - - - - $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``)) - $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``)) - - - - - %(PaketRestoreCachedKeyValue.Value) - %(PaketRestoreCachedKeyValue.Value) - - - - - true - false - true - - - - - true - - - - - - - - - - - - - - - - - - - $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached - - $(MSBuildProjectFullPath).paket.references - - $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references - - $(MSBuildProjectDirectory)\paket.references - - false - true - true - references-file-or-cache-not-found - - - - - $([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)')) - $([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)')) - references-file - false - - - - - false - - - - - true - target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths) - - - - - - - - - - - false - true - - - - - - - - - - - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5]) - - - %(PaketReferencesFileLinesInfo.PackageVersion) - All - runtime - runtime - true - true - - - - - $(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools - - - - - - - - - $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0]) - $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1]) - - - %(PaketCliToolFileLinesInfo.PackageVersion) - - - - - - - - - - false - - - - - - <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/> - - - - - - $(MSBuildProjectDirectory)/$(MSBuildProjectFile) - true - false - true - false - true - false - true - false - true - $(PaketIntermediateOutputPath)\$(Configuration) - $(PaketIntermediateOutputPath) - - - - <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/> - - - - - - - - - - - - - - - - - - - - - diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props deleted file mode 100644 index 7988ee2f36..0000000000 --- a/fcs/Directory.Build.props +++ /dev/null @@ -1,37 +0,0 @@ - - - - - $(RestoreSources); - https://api.nuget.org/v3/index.json; - https://dotnet.myget.org/F/fsharp/api/v3/index.json; - - - - - $(UserProfile)\.nuget\packages\ - $(HOME)/.nuget/packages/ - $(NuGetPackageRoot)\ - $(NuGetPackageRoot)/ - $(MSBuildThisFileDirectory)..\artifacts - $(ArtifactsDir)\bin - $(ArtifactsDir)\obj - $(ArtifactsBinDir)\fcs\$(Configuration) - $(ArtifactsObjDir)\fcs\$(Configuration) - true - - - - - $(MSBuildThisFileDirectory)..\src - 22.0.3 - --version:$(VersionPrefix) - false - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools - fsi.exe - 4.6.2 - net461 - - diff --git a/fcs/Directory.Build.targets b/fcs/Directory.Build.targets deleted file mode 100644 index 00f6e63aa8..0000000000 --- a/fcs/Directory.Build.targets +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - <__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') - <__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)') - - <_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)')) - <_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)')) - <_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)')) - - <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory) - <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never - - - - - - - - - - - - - - - - <_BuildPropertyLines Remove="@(_BuildPropertyLines)" /> - <_BuildPropertyLines Include="// <auto-generated >" /> - <_BuildPropertyLines Include="// <Generated by the FSharp WriteCodeFragment class./>" /> - <_BuildPropertyLines Include="// </auto-generated/>" /> - <_BuildPropertyLines Include="//" /> - <_BuildPropertyLines Include="module internal FSharp.BuildProperties" /> - <_BuildPropertyLines Include="let fsProductVersion = "$(FSPRODUCTVERSION)"" /> - <_BuildPropertyLines Include="let fsLanguageVersion = "$(FSLANGUAGEVERSION)"" /> - - - - - - - - - - - - diff --git a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj deleted file mode 100644 index 9e3ecf6a10..0000000000 --- a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - $(FcsTargetNetFxFramework) - true - $(DefineConstants);CROSS_PLATFORM_COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT - embedded - - - Additional DLL for legacy compat for the F# compiler service. - Additional DLL for legacy compat for the F# compiler service. - false - F# community contributors - MIT - https://github.com/fsharp/FSharp.Compiler.Service - logo.png - F#, compiler, msbuild - - - - - Service/MSBuildReferenceResolver.fs - - - - - - - - - - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/.gitignore b/fcs/FSharp.Compiler.Service.Tests/.gitignore deleted file mode 100644 index eabace925a..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -watson-test.exe diff --git a/fcs/FSharp.Compiler.Service.Tests/App.config b/fcs/FSharp.Compiler.Service.Tests/App.config deleted file mode 100644 index 380c93a453..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/App.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj b/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj deleted file mode 100644 index 6bded08333..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - net461;netstandard2.0 - $(FcsTargetNetFxFramework);netstandard2.0 - false - $(NoWarn);0067;1591 - - - - - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj deleted file mode 100644 index 7f3b33ad92..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - - $(FcsTargetNetFxFramework);netcoreapp3.1 - true - 4.1.19 - $(NoWarn);44;75; - true - true - ..\..\$(Configuration.ToLower())\fcs - portable - false - true - true - - - $(DefineConstants);NO_PROJECTCRACKER - $(DefineConstants);FCS - - - - FsUnit.fs - - - Common.fs - - - AssemblyReaderShim.fs - - - EditorTests.fs - - - Symbols.fs - - - FileSystemTests.fs - - - ProjectAnalysisTests.fs - - - MultiProjectAnalysisTests.fs - - - PerfTests.fs - - - InteractiveCheckerTests.fs - - - ExprTests.fs - - - CSharpProjectAnalysis.fs - - - StructureTests.fs - - - TokenizerTests.fs - - - ServiceUntypedParseTests.fs - - - TreeVisitorTests.fs - - - PatternMatchCompilationTests.fs - - - ScriptOptionsTests.fs - - - Program.fs - - - {{FSCoreVersion}} - $(FSCoreVersion) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/FsxCompletionProviderTests.fs b/fcs/FSharp.Compiler.Service.Tests/FsxCompletionProviderTests.fs deleted file mode 100644 index 236caff428..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/FsxCompletionProviderTests.fs +++ /dev/null @@ -1,161 +0,0 @@ -// To run the tests in this file: -// -// Technique 1: Compile VisualFSharp.UnitTests.dll and run it as a set of unit tests -// -// Technique 2: -// -// Enable some tests in the #if EXE section at the end of the file, -// then compile this file as an EXE that has InternalsVisibleTo access into the -// appropriate DLLs. This can be the quickest way to get turnaround on updating the tests -// and capturing large amounts of structured output. -(* - cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\FsxCompletionProviderTests.fs - .\VisualFSharp.UnitTests.exe -*) -// Technique 3: -// -// Use F# Interactive. This only works for FSharp.Compiler.Service.dll which has a public API - -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn - -open System -open System.Collections.Generic -open System.IO -open System.Linq -open System.Reflection - -open NUnit.Framework - -open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Completion -open Microsoft.CodeAnalysis.Text -open Microsoft.VisualStudio.FSharp.Editor - -open FSharp.Compiler.SourceCodeServices -open UnitTests.TestLib.LanguageService - -// AppDomain helper -type Worker () = - inherit MarshalByRefObject() - - let filePath = "C:\\test.fsx" - let projectOptions = { - ProjectFileName = "C:\\test.fsproj" - ProjectId = None - SourceFiles = [| filePath |] - ReferencedProjects = [| |] - OtherOptions = [| |] - IsIncompleteTypeCheckEnvironment = true - UseScriptResolutionRules = true - LoadTime = DateTime.MaxValue - OriginalLoadReferences = [] - UnresolvedReferences = None - ExtraProjectInfo = None - Stamp = None - } - - let formatCompletions(completions : string seq) = - "\n\t" + String.Join("\n\t", completions) - - let VerifyCompletionList(fileContents: string, marker: string, expected: string list, unexpected: string list) = - let caretPosition = fileContents.IndexOf(marker) + marker.Length - let results = - FSharpCompletionProvider.ProvideCompletionsAsyncAux(checker, SourceText.From(fileContents), caretPosition, projectOptions, filePath, 0, (fun _ -> []), LanguageServicePerformanceOptions.Default, IntelliSenseOptions.Default) - |> Async.RunSynchronously - |> Option.defaultValue (ResizeArray()) - |> Seq.map(fun result -> result.DisplayText) - - let expectedFound = - expected - |> Seq.filter results.Contains - - let expectedNotFound = - expected - |> Seq.filter (expectedFound.Contains >> not) - - let unexpectedNotFound = - unexpected - |> Seq.filter (results.Contains >> not) - - let unexpectedFound = - unexpected - |> Seq.filter (unexpectedNotFound.Contains >> not) - - // If either of these are true, then the test fails. - let hasExpectedNotFound = not (Seq.isEmpty expectedNotFound) - let hasUnexpectedFound = not (Seq.isEmpty unexpectedFound) - - if hasExpectedNotFound || hasUnexpectedFound then - let expectedNotFoundMsg = - if hasExpectedNotFound then - sprintf "\nExpected completions not found:%s\n" (formatCompletions expectedNotFound) - else - String.Empty - - let unexpectedFoundMsg = - if hasUnexpectedFound then - sprintf "\nUnexpected completions found:%s\n" (formatCompletions unexpectedFound) - else - String.Empty - - let completionsMsg = sprintf "\nin Completions:%s" (formatCompletions results) - - let msg = sprintf "%s%s%s" expectedNotFoundMsg unexpectedFoundMsg completionsMsg - - Assert.Fail(msg) - - member __.VerifyCompletionListExactly(fileContents: string, marker: string, expected: List) = - - let caretPosition = fileContents.IndexOf(marker) + marker.Length - let expected = expected |> Seq.toList - let actual = - let x = FSharpCompletionProvider.ProvideCompletionsAsyncAux(checker, SourceText.From(fileContents), caretPosition, projectOptions, filePath, 0, (fun _ -> []), LanguageServicePerformanceOptions.Default, IntelliSenseOptions.Default) - |> Async.RunSynchronously - x |> Option.defaultValue (ResizeArray()) - |> Seq.toList - // sort items as Roslyn do - by `SortText` - |> List.sortBy (fun x -> x.SortText) - - let actualNames = actual |> List.map (fun x -> x.DisplayText) - - if actualNames <> expected then - Assert.Fail(sprintf "Expected:\n%s,\nbut was:\n%s\nactual with sort text:\n%s" - (String.Join("; ", expected |> List.map (sprintf "\"%s\""))) - (String.Join("; ", actualNames |> List.map (sprintf "\"%s\""))) - (String.Join("\n", actual |> List.map (fun x -> sprintf "%s => %s" x.DisplayText x.SortText)))) - -module FsxCompletionProviderTests = - - let pathToThisDll = Assembly.GetExecutingAssembly().CodeBase - - let getWorker () = - - let adSetup = - let setup = new System.AppDomainSetup () - setup.PrivateBinPath <- pathToThisDll - setup.ApplicationBase <- Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SomeNonExistentDirectory") - setup - - let ad = AppDomain.CreateDomain((Guid()).ToString(), null, adSetup) - (ad.CreateInstanceFromAndUnwrap(pathToThisDll, typeof.FullName)) :?> Worker - - [] - let fsiShouldTriggerCompletionInFsxFile() = - - let fileContents = """ - fsi. - """ - let expected = List([ - "CommandLineArgs"; "EventLoop"; "FloatingPointFormat"; "FormatProvider"; "PrintDepth"; - "PrintLength"; "PrintSize"; "PrintWidth"; "ShowDeclarationValues"; "ShowIEnumerable"; - "ShowProperties"; "AddPrinter"; "AddPrintTransformer"; "Equals"; "GetHashCode"; - "GetType"; "ToString"; ]) - - // We execute in a seperate appdomain so that we can set BaseDirectory to a non-existent location - getWorker().VerifyCompletionListExactly(fileContents, "fsi.", expected) - -#if EXE -ShouldTriggerCompletionInFsxFile() -#endif diff --git a/fcs/FSharp.Compiler.Service.Tests/ProjectOptionsBuilder.fs b/fcs/FSharp.Compiler.Service.Tests/ProjectOptionsBuilder.fs deleted file mode 100644 index 106b7602a5..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/ProjectOptionsBuilder.fs +++ /dev/null @@ -1,154 +0,0 @@ -namespace VisualFSharp.UnitTests.Roslyn - -open System -open System.IO -open System.Xml.Linq -open FSharp.Compiler.SourceCodeServices - -module FileSystemHelpers = - let safeDeleteFile (path: string) = - try - File.Delete(path) - with - | _ -> () - - let safeDeleteDirectory (path: string) = - try - Directory.Delete(path) - with - | _ -> () - -type FSharpProject = - { - Directory: string - Options: FSharpProjectOptions - Files: (string * string) list - } - - /// Strips cursor information from each file and returns the name and cursor position of the last file to specify it. - member this.GetCaretPosition () = - let caretSentinel = "$$" - let mutable cursorInfo: (string * int) = (null, 0) - this.Files - |> List.iter (fun (name, contents) -> - // find the '$$' sentinel that represents the cursor location - let caretPosition = contents.IndexOf(caretSentinel) - if caretPosition >= 0 then - let newContents = contents.Substring(0, caretPosition) + contents.Substring(caretPosition + caretSentinel.Length) - File.WriteAllText(Path.Combine(this.Directory, name), newContents) - cursorInfo <- (name, caretPosition)) - cursorInfo - interface IDisposable with - member this.Dispose() = - // delete each source file - this.Files - |> List.map fst - |> List.iter FileSystemHelpers.safeDeleteFile - // delete the directory - FileSystemHelpers.safeDeleteDirectory (this.Directory) - // project file doesn't really exist, nothing to delete - () - -[] -module internal ProjectOptionsBuilder = - let private FileName = XName.op_Implicit "File" - let private NameName = XName.op_Implicit "Name" - let private ProjectName = XName.op_Implicit "Project" - let private ReferenceName = XName.op_Implicit "Reference" - - let private CreateSingleProjectFromMarkup(markup:XElement) = - if markup.Name.LocalName <> "Project" then failwith "Expected root node to be " - let projectRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()) - if Directory.Exists(projectRoot) then Directory.Delete(projectRoot, true) - Directory.CreateDirectory(projectRoot) |> ignore - let files = // filename -> fileContents - markup.Elements(FileName) - |> Seq.map (fun file -> - let fileName = Path.Combine(projectRoot, file.Attribute(NameName).Value) - let fileContents = file.Value - File.WriteAllText(fileName, fileContents) - (fileName, fileContents)) - |> List.ofSeq - let options = - { - ProjectFileName = Path.Combine(projectRoot, markup.Attribute(NameName).Value) - ProjectId = None - SourceFiles = files |> Seq.map fst |> Array.ofSeq - ReferencedProjects = [||] // potentially filled in later - OtherOptions = [||] - IsIncompleteTypeCheckEnvironment = true - UseScriptResolutionRules = false - LoadTime = DateTime.MaxValue - OriginalLoadReferences = [] - UnresolvedReferences = None - ExtraProjectInfo = None - Stamp = None - } - { - Directory = projectRoot - Options = options - Files = files - } - - let private CreateMultipleProjectsFromMarkup(markup:XElement) = - if markup.Name.LocalName <> "Projects" then failwith "Expected root node to be " - let projectsAndXml = - markup.Elements(ProjectName) - |> Seq.map (fun xml -> (CreateSingleProjectFromMarkup xml, xml)) - |> List.ofSeq - // setup project references - let projectMap = - projectsAndXml - |> List.map (fun (projectOptions, _xml) -> - let normalizedProjectName = Path.GetFileName(projectOptions.Options.ProjectFileName) - (normalizedProjectName, projectOptions)) - |> Map.ofList - let projects = - projectsAndXml - |> List.map(fun (projectOptions, xml) -> - // bind references to their `FSharpProjectOptions` counterpart - let referenceList = - xml.Elements(ReferenceName) - |> Seq.map (fun reference -> reference.Value) - |> Seq.fold (fun list reference -> reference :: list) [] - |> List.rev - |> List.map (fun referencedProject -> - let project = projectMap.[referencedProject] - let asmName = Path.GetFileNameWithoutExtension(project.Options.ProjectFileName) - let binaryPath = Path.Combine(project.Directory, "bin", asmName + ".dll") - (binaryPath, project.Options)) - |> Array.ofList - let binaryRefs = - referenceList - |> Array.map fst - |> Array.map (fun r -> "-r:" + r) - let otherOptions = Array.append projectOptions.Options.OtherOptions binaryRefs - { projectOptions with - Options = { projectOptions.Options with - ReferencedProjects = referenceList - OtherOptions = otherOptions - } - }) - let rootProject = List.head projects - rootProject - - let CreateProjectFromMarkup(markup:XElement) = - match markup.Name.LocalName with - | "Project" -> CreateSingleProjectFromMarkup markup - | "Projects" -> CreateMultipleProjectsFromMarkup markup - | name -> failwith <| sprintf "Unsupported root node name: %s" name - - let CreateProject(markup:string) = - XDocument.Parse(markup).Root - |> CreateProjectFromMarkup - - let SingleFileProject(code:string) = - code - |> sprintf @" - - - - - -" - |> CreateProject diff --git a/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs b/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs deleted file mode 100644 index 415079942e..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs +++ /dev/null @@ -1,445 +0,0 @@ -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn - -open System.IO -open FSharp.Compiler.SourceCodeServices -open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Text -open Microsoft.VisualStudio.FSharp.Editor -open NUnit.Framework -open UnitTests.TestLib.LanguageService -open VisualFSharp.UnitTests.Roslyn - -[] -module QuickInfo = - -let internal GetQuickInfo (project:FSharpProject) (fileName:string) (caretPosition:int) = - async { - let code = File.ReadAllText(fileName) - let sourceText = SourceText.From(code) - let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) // only used for caching purposes - return! FSharpAsyncQuickInfoSource.ProvideQuickInfo(checker, documentId, sourceText, fileName, caretPosition, FSharpParsingOptions.Default, project.Options, 0, LanguageServicePerformanceOptions.Default) - } |> Async.RunSynchronously - -let GetQuickInfoText (project:FSharpProject) (fileName:string) (caretPosition:int) = - let sigHelp = GetQuickInfo project fileName caretPosition - match sigHelp with - | Some (quickInfo) -> - let documentationBuilder = - { new IDocumentationBuilder with - override __.AppendDocumentationFromProcessedXML(_, _, _, _, _, _) = () - override __.AppendDocumentation(_, _, _, _, _, _, _) = () - } - let mainDescription, docs = FSharpAsyncQuickInfoSource.BuildSingleQuickInfoItem documentationBuilder quickInfo - let mainTextItems = - mainDescription - |> Seq.map (fun x -> x.Text) - let docTextItems = - docs - |> Seq.map (fun x -> x.Text) - System.String.Join(System.String.Empty, (Seq.concat [mainTextItems; docTextItems])) - | _ -> "" - -let GetQuickInfoTextFromCode (code:string) = - use project = SingleFileProject code - let fileName, caretPosition = project.GetCaretPosition() - GetQuickInfoText project fileName caretPosition - -let expectedLines (lines:string list) = System.String.Join("\n", lines) - -// migrated from legacy test -[] -let ``Automation.EnumDUInterfacefromFSBrowse.InsideComputationExpression`` () = - let code = """ -namespace FsTest - -type MyColors = - | Red = 0 - | Green = 1 - | Blue = 2 - -module Test = - let test() = - let x = - seq { - for i in 1..10 do - let f = MyColors.Re$$d - yield f - } - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "MyColors.Red: MyColors = 0" - Assert.AreEqual(expected, quickInfo) - -// migrated from legacy test -[] -let ``Automation.EnumDUInterfacefromFSBrowse.InsideMatch`` () = - let code = """ -namespace FsTest - -type MyDistance = - | Kilometers of float - | Miles of float - | NauticalMiles of float - -module Test = - let test() = - let myDuList = (fun x -> - match x with - | 0 -> MyDistanc$$e.Kilometers - | 1 -> MyDistance.Miles - | _ -> MyDistance.NauticalMiles - ) - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = - expectedLines [ "type MyDistance =" - " | Kilometers of float" - " | Miles of float" - " | NauticalMiles of float" - "Full name: FsTest.MyDistance" ] - Assert.AreEqual(expected, quickInfo) - -// migrated from legacy test -[] -let ``Automation.EnumDUInterfacefromFSBrowse.InsideLambda`` () = - let code = """ -namespace FsTest - -type IMyInterface = - interface - abstract Represent : unit -> string - end - -type MyTestType() = - [] - val mutable field : int - - interface IMyInterface with - member this.Represent () = "Implement Interface" - -module Test = - let test() = - let s = new MyTestType() - |> fun (x:MyTestType) -> x :> IMyInterface - |> fun (x:IMyInterface) -> x.Represen$$t() - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "abstract member IMyInterface.Represent : unit -> string" - Assert.AreEqual(expected, quickInfo) - -// migrated from legacy test -[] -let ``Automation.RecordAndInterfaceFromFSProj.InsideComputationExpression``() = - let code = """ -namespace FsTest - -type MyEmployee = - { mutable Name : string; - mutable Age : int; - mutable IsFTE : bool } - -module Test = - let test() = - let construct = - seq { - for i in 1..10 do - let a = MyEmploye$$e.MakeDummy() - () - } - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = - expectedLines [ "type MyEmployee =" - " { mutable Name: string" - " mutable Age: int" - " mutable IsFTE: bool }" - "Full name: FsTest.MyEmployee" ] - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.RecordAndInterfaceFromFSProj.InsideQuotation``() = - let code = """ -namespace FsTest - -type MyEmployee = - { mutable Name : string; - mutable Age : int; - mutable IsFTE : bool } - -module Test = - let test() = - let aa = { Name: "name"; - Age: 1; - IsFTE: false; } - let b = <@ a$$a.Name @> - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val aa : MyEmployee" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.RecordAndInterfaceFromFSProj.InsideLambda``() = - let code = """ -namespace FsTest - -type MyEmployee = - { mutable Name : string; - mutable Age : int; - mutable IsFTE : bool } - -module Test = - let test() = - let aa = { Name: "name"; - Age: 1; - IsFTE: false; } - let b = - [ aa ] - |> List.filter (fun e -> e.IsFT$$E) - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "MyEmployee.IsFTE: bool" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.TupleRecordFromFSBrowse.InsideComputationExpression``() = - let code = """ -namespace FsTest - -module Test = - let GenerateTuple = - fun x -> - let tuple = (x, x.ToString(), (float)x, (fun y -> (y.ToString(), y + 1))) - tuple - let test() = - let mySeq = - seq { - for i in 1..9 do - let my$$Tuple = GenerateTuple i - yield myTuple - } - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val myTuple : int * string * float * (int -> string * int)" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.TupleRecordFromFSBrowse.SequenceOfMethods``() = - let code = """ -namespace FsTest - -module Test = - let GenerateTuple = - fun x -> - let tuple = (x, x.ToString(), (float)x, (fun y -> (y.ToString(), y + 1))) - tuple - let GetTupleMethod tuple = - let (_intInTuple, _stringInTuple, _floatInTuple, methodInTuple) = tuple - methodInTuple - let test() = - let mySeq = - seq { - for i in 1..9 do - let myTuple = GenerateTuple i - yield myTuple - } - let method$$Seq = Seq.map GetTupleMethod mySeq - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val methodSeq : seq<(int -> string * int)>" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.MatchExpression``() = - let code = """ -namespace FsTest - -[] -type MyPoint(x:int, y:int) = - member this.X = x - member this.Y = y - -module Test = - let test() = - let p1 = MyPoint(1, 2) - match p$$1 with - | p3 when p3.X = 1 -> 0 - | _ -> 1 -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val p1 : MyPoint" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.MatchPattern``() = - let code = """ -namespace FsTest - -[] -type MyPoint(x:int, y:int) = - member this.X = x - member this.Y = y - -module Test = - let test() = - let p1 = MyPoint(1, 2) - match p1 with - | p$$3 when p3.X = 1 -> 0 - | _ -> 1 -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val p3 : MyPoint" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.UnionIfPredicate``() = - let code = """ -namespace FsTest - -type MyDistance = - | Kilometers of float - | Miles of float - | NauticalMiles of float - -module Test = - let test() = - let dd = MyDistance.Kilometers 1.0 - if MyDistance.toMiles d$$d > 0 then () - else () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val dd : MyDistance" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.UnionForPattern``() = - let code = """ -namespace FsTest - -type MyDistance = - | Kilometers of float - | Miles of float - | NauticalMiles of float - -module Test = - let test() = - let distances = [ MyDistance.Kilometers 1.0; MyDistance.Miles 1.0 ] - for dist$$ance in distances do - () -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "val distance : MyDistance" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.UnionMethodPatternMatch``() = - let code = """ -namespace FsTest - -type MyDistance = - | Kilometers of float - | Miles of float - | NauticalMiles of float - static member toMiles x = - Miles( - match x with - | Miles x -> x - | Kilometers x -> x / 1.6 - | NauticalMiles x -> x * 1.15 - ) - -module Test = - let test() = - let dd = MyDistance.Kilometers 1.0 - match MyDistance.to$$Miles dd with - | Miles x -> 0 - | _ -> 1 -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "static member MyDistance.toMiles : x:MyDistance -> MyDistance" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.UnionMethodPatternMatchBody``() = - let code = """ -namespace FsTest - -type MyDistance = - | Kilometers of float - | Miles of float - | NauticalMiles of float - member this.IncreaseBy dist = - match this with - | Kilometers x -> Kilometers (x + dist) - | Miles x -> Miles (x + dist) - | NauticalMiles x -> NauticalMiles (x + dist) - -module Test = - let test() = - let dd = MyDistance.Kilometers 1.0 - match dd.toMiles() with - | Miles x -> dd.Increase$$By 1.0 - | _ -> dd -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "member MyDistance.IncreaseBy : dist:float -> MyDistance" - Assert.AreEqual(expected, quickInfo) - () - -// migrated from legacy test -[] -let ``Automation.UnionAndStructFromFSProj.UnionPropertyInComputationExpression``() = - let code = """ -namespace FsTest - -type MyDistance = - | Kilometers of float - | Miles of float - | NauticalMiles of float - member this.asNautical = - NauticalMiles( - match this with - | Kilometers x -> x / 1.852 - | Miles x -> x / 1.15 - | NauticalMiles x -> x - ) - -module Test = - let test() = - let dd = MyDistance.Kilometers 1.0 - async { - let r = dd.as$$Nautical - return r - } -""" - let quickInfo = GetQuickInfoTextFromCode code - let expected = "property MyDistance.asNautical: MyDistance with get" - Assert.AreEqual(expected, quickInfo) - () diff --git a/fcs/FSharp.Compiler.Service.Tests/RoslynSourceTextTests.fs b/fcs/FSharp.Compiler.Service.Tests/RoslynSourceTextTests.fs deleted file mode 100644 index 9a817df977..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/RoslynSourceTextTests.fs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn - -open System -open NUnit.Framework - -open Microsoft.VisualStudio.FSharp.Editor -open FSharp.Compiler.Text -open Microsoft.CodeAnalysis.Text - -[] -module RoslynSourceTextTests = - - [] - let SourceText () = - let text = "test\ntest2\r\ntest3\n\ntest4\ntest5\rtest6\n" - let sourceText = SourceText.From(text).ToFSharpSourceText() - - Assert.AreEqual("test", sourceText.GetLineString(0)) - Assert.AreEqual("test2", sourceText.GetLineString(1)) - Assert.AreEqual("test3", sourceText.GetLineString(2)) - Assert.AreEqual("", sourceText.GetLineString(3)) - Assert.AreEqual("test4", sourceText.GetLineString(4)) - Assert.AreEqual("test5", sourceText.GetLineString(5)) - Assert.AreEqual("test6", sourceText.GetLineString(6)) - Assert.AreEqual("", sourceText.GetLineString(7)) - Assert.AreEqual(8, sourceText.GetLineCount()) - - let (count, length) = sourceText.GetLastCharacterPosition() - Assert.AreEqual(8, count) - Assert.AreEqual(0, length) - - Assert.True(sourceText.SubTextEquals("test", 0)) - Assert.True(sourceText.SubTextEquals("test2", 5)) - Assert.True(sourceText.SubTextEquals("test3", 12)) - - Assert.Throws(fun () -> sourceText.SubTextEquals("test", -1) |> ignore) |> ignore - Assert.Throws(fun () -> sourceText.SubTextEquals("test", text.Length) |> ignore) |> ignore - Assert.Throws(fun () -> sourceText.SubTextEquals("", 0) |> ignore) |> ignore - Assert.Throws(fun () -> sourceText.SubTextEquals(text + text, 0) |> ignore) |> ignore - - Assert.False(sourceText.SubTextEquals("test", 1)) - Assert.False(sourceText.SubTextEquals("test", 4)) - Assert.False(sourceText.SubTextEquals("test", 11)) \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/SemanticColorizationServiceTests.fs b/fcs/FSharp.Compiler.Service.Tests/SemanticColorizationServiceTests.fs deleted file mode 100644 index e1591ed0cb..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/SemanticColorizationServiceTests.fs +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn - -open System -open NUnit.Framework -open Microsoft.VisualStudio.FSharp.Editor -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler -open Microsoft.CodeAnalysis.Text -open Microsoft.CodeAnalysis.Classification - -[] -type SemanticClassificationServiceTests() = - let filePath = "C:\\test.fs" - - let projectOptions = { - ProjectFileName = "C:\\test.fsproj" - ProjectId = None - SourceFiles = [| filePath |] - ReferencedProjects = [| |] - OtherOptions = [| |] - IsIncompleteTypeCheckEnvironment = true - UseScriptResolutionRules = false - LoadTime = DateTime.MaxValue - UnresolvedReferences = None - OriginalLoadReferences = [] - ExtraProjectInfo = None - Stamp = None - } - - let checker = FSharpChecker.Create() - let perfOptions = { LanguageServicePerformanceOptions.Default with AllowStaleCompletionResults = false } - - let getRanges (source: string) : struct (Range.range * SemanticClassificationType) list = - asyncMaybe { - - let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, 0, SourceText.From(source), projectOptions, perfOptions, "") - return checkFileResults.GetSemanticClassification(None) - } - |> Async.RunSynchronously - |> Option.toList - |> List.collect Array.toList - - let verifyClassificationAtEndOfMarker(fileContents: string, marker: string, classificationType: string) = - let text = SourceText.From(fileContents) - let ranges = getRanges fileContents - let line = text.Lines.GetLinePosition (fileContents.IndexOf(marker) + marker.Length - 1) - let markerPos = Range.mkPos (Range.Line.fromZ line.Line) (line.Character + marker.Length - 1) - match ranges |> List.tryFind (fun struct (range, _) -> Range.rangeContainsPos range markerPos) with - | None -> Assert.Fail("Cannot find colorization data for end of marker") - | Some(_, ty) -> Assert.AreEqual(classificationType, FSharpClassificationTypes.getClassificationTypeName ty, "Classification data doesn't match for end of marker") - - let verifyNoClassificationDataAtEndOfMarker(fileContents: string, marker: string, classificationType: string) = - let text = SourceText.From(fileContents) - let ranges = getRanges fileContents - let line = text.Lines.GetLinePosition (fileContents.IndexOf(marker) + marker.Length - 1) - let markerPos = Range.mkPos (Range.Line.fromZ line.Line) (line.Character + marker.Length - 1) - let anyData = ranges |> List.exists (fun struct (range, sct) -> Range.rangeContainsPos range markerPos && ((FSharpClassificationTypes.getClassificationTypeName sct) = classificationType)) - Assert.False(anyData, "Classification data was found when it wasn't expected.") - - [] - [] - [] - [] - [] - [] - [] - member __.Measured_Types(marker: string, classificationType: string) = - verifyClassificationAtEndOfMarker( - """#light (*Light*) - open System - - [] type (*1*)Guid<[] 'm> = Guid - [] type (*2*)string<[] 'm> = string - - let inline cast<'a, 'b> (a : 'a) : 'b = (# "" a : 'b #) - - type Uom = - static member inline tag<[]'m> (x : Guid) : (*3*)Guid<'m> = cast x - static member inline tag<[]'m> (x : string) : (*4*)string<'m> = cast x - - type [] Ms - - let i: (*5*)int = 1 - let g: (*6*)Guid = Uom.tag Guid.Empty - let s: (*7*)string = Uom.tag "foo" """, - marker, - classificationType) - - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - member __.MutableValues(marker: string, classificationType: string) = - let sourceText =""" -type R1 = { mutable (*1*)Doop: int} -let r1 = { (*2*)Doop = 12 } -r1.Doop - -let mutable (*3*)first = 12 - -printfn "%d" (*4*)first - -let g ((*5*)xRef: outref) = (*6*)xRef <- 12 - -let f() = - let (*7*)second = &first - let (*8*)third: outref = &first - printfn "%d%d" (*9*)second (*10*)third - -type R = { (*11*)MutableField: int ref } -let r = { (*12*)MutableField = ref 12 } -r.MutableField -r.MutableField := 3 -""" - verifyClassificationAtEndOfMarker(sourceText, marker, classificationType) - - - [] - [] - [] - [] - [] - [] - member __.NoInrefsExpected(marker: string, classificationType: string) = - let sourceText = """ -let f (item: (*1*)inref) = printfn "%d" (*2*)item -let g() = - let x = 1 - let y = 2 - let (*3*)xRef = &x - let (*4*)yRef: inref = &y - f (*5*)&xRef - f (*6*)&yRef -""" - verifyNoClassificationDataAtEndOfMarker(sourceText, marker, classificationType) \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/SyntacticColorizationServiceTests.fs b/fcs/FSharp.Compiler.Service.Tests/SyntacticColorizationServiceTests.fs deleted file mode 100644 index 05b0d39e7a..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/SyntacticColorizationServiceTests.fs +++ /dev/null @@ -1,1056 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn - -open System -open System.Threading - -open NUnit.Framework - -open Microsoft.CodeAnalysis.Classification -open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Text -open Microsoft.VisualStudio.FSharp.Editor - -[][] -type SyntacticClassificationServiceTests() = - - member private this.ExtractMarkerData(fileContents: string, marker: string, defines: string list, isScriptFile: Option) = - let textSpan = TextSpan(0, fileContents.Length) - let fileName = if isScriptFile.IsSome && isScriptFile.Value then "test.fsx" else "test.fs" - let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) - let tokens = Tokenizer.getClassifiedSpans(documentId, SourceText.From(fileContents), textSpan, Some(fileName), defines, CancellationToken.None) - let markerPosition = fileContents.IndexOf(marker) - Assert.IsTrue(markerPosition >= 0, "Cannot find marker '{0}' in file contents", marker) - (tokens, markerPosition) - - member private this.VerifyColorizerAtStartOfMarker(fileContents: string, marker: string, defines: string list, classificationType: string, ?isScriptFile: bool) = - let (tokens, markerPosition) = this.ExtractMarkerData(fileContents, marker, defines, isScriptFile) - match tokens |> Seq.tryFind(fun token -> token.TextSpan.Contains(markerPosition)) with - | None -> Assert.Fail("Cannot find colorization data for start of marker") - | Some(classifiedSpan) -> Assert.AreEqual(classificationType, classifiedSpan.ClassificationType, "Classification data doesn't match for start of marker") - - member private this.VerifyColorizerAtEndOfMarker(fileContents : string, marker: string, defines: string list, classificationType: string, ?isScriptFile: bool) = - let (tokens, markerPosition) = this.ExtractMarkerData(fileContents, marker, defines, isScriptFile) - match tokens |> Seq.tryFind(fun token -> token.TextSpan.Contains(markerPosition + marker.Length - 1)) with - | None -> Assert.Fail("Cannot find colorization data for end of marker") - | Some(classifiedSpan) -> Assert.AreEqual(classificationType, classifiedSpan.ClassificationType, "Classification data doesn't match for end of marker") - - [] - member this.Comment_SingleLine() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - let simplefunction x y = x + y // Test1SimpleComment""", - marker = "// Test1", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Conment_SingleLine_MultiConments() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - let x = // Test2SimpleComment // 1""", - marker = "// Test2", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_MultiLine_AfterAnExpression() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - let mutliLine x = 5(* Test1MultiLine - Test2MultiLine <@@asdf@@> - Test3MultiLine*) + 1(*Test4*)""", - marker = "Test1", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_MultiLine_WithLineBreakAndATab() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - let mutliLine x = 5(* Test1MultiLine - Test2MultiLine <@@asdf@@> - Test3MultiLine*) + 1(*Test4*) - """, - marker = "Test2", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_MultiLine_WithLineBreakAfterQuotExp() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - let mutliLine x = 5(* Test1MultiLine - Test2MultiLine <@@asdf@@> - Test3MultiLine*) + 1(*Test4*) - """, - marker = "Test3", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_MultiLine_AfterANumber() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let mutliLine x = 5(* Test1MultiLine - Test2MultiLine <@@asdf@@> - Test3MultiLine*) + 1(*Test4*) - """, - marker = "1(*Test4*)", - defines = [], - classificationType = ClassificationTypeNames.NumericLiteral) - - [] - member this.Comment_Nested_Nested01() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - (* L1Nesting - (* L2Nesting - (* L3 Nesting - let l3code = 3 - *) - let l2code = 2 - *) - let l1code = 1 - *) - let l0code = 0 - """, - marker = "let l3", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_Nested_Nested02() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - (* L1Nesting - (* L2Nesting - (* L3 Nesting - let l3code = 3 - *) - let l2code = 2 - *) - let l1code = 1 - *) - let l0code = 0 - """, - marker = "let l2", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_Nested_Nested03() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - (* L1Nesting - (* L2Nesting - (* L3 Nesting - let l3code = 3 - *) - let l2code = 2 - *) - let l1code = 1 - *) - let l0code = 0 - """, - marker = "let l1", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_Nested_IdentAfterNestedComments() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - (* L1Nesting - (* L2Nesting - (* L3 Nesting - let l3code = 3 - *) - let l2code = 2 - *) - let l1code = 1 - *) - let l0code = 0 - """, - marker = "let l0", - defines = [], - classificationType = ClassificationTypeNames.Identifier) - - [] - member this.Comment_CommentInString() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - let commentsInString = "...(*test1_comment_in_string_literal*)..." - )""", - marker = "test1", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.Comment_StringInComment() = - this.VerifyColorizerAtEndOfMarker( - fileContents = """ - (* - let commentsInString2 = "...*)test2_stringliteral_in_comment(*..." - *)""", - marker = "test2", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_Unterminated_KeywordBeforeComment() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - type IPeekPoke = interface(*ML Comment Start - abstract member Peek: unit -> int - abstract member Poke: int -> unit - end - """, - marker = "face(*ML Comment Start", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Comment_Unterminated_KeywordInComment() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - type IPeekPoke = interface(*ML Comment Start - abstract member Peek: unit -> int - abstract member Poke: int -> unit - end - - type wodget = class - val mutable state: int - interface IPeekPoke with(*Few Lines Later2*) - member x.Poke(n) = x.state <- x.state + n - member x.Peek() = x.state - end - end(*Few Lines Later3*)""", - marker = "with(*Few Lines Later2*)", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.Comment_Unterminated_NestedComments() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - type IPeekPoke = interface(*ML Comment Start - abstract member Peek: unit -> int - abstract member Poke: int -> unit - end - - type wodget = class - val mutable state: int - interface IPeekPoke with(*Few Lines Later2*) - member x.Poke(n) = x.state <- x.state + n - member x.Peek() = x.state - end - member x.HasBeenPoked = (x.state <> 0) - new() = { state = 0 } - end(*Few Lines Later3*)""", - marker = "nd(*Few Lines Later3*)", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - [] - member this.String_AtEnd() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let stringone = "simple string test"(*Simple String*) """, - marker = """est"(*Simple String*)""", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.String_MultiLines() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let stringtwo = "simple test(*MultiLine - First*) - string test"(*MultiLine - Second*)""", - marker = "st(*MultiLine - First*)", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.String_MultiLines_LineBreak() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let stringtwo = "simple test(*MultiLine - First*) - string test"(*MultiLine - Second*) """, - marker = "\"(*MultiLine - Second*) ", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.String_Literal() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let stringthree = @"literal test"(*Literal String*)""", - marker = """st"(*Literal String*)""", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.ByteString_AtEnd() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let bytestringone = "abcdefg"B(*Byte String*)""", - marker = "B(*Byte String*)", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.ByteString_MultiLines() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let bytestringtwo = "simple(*MultiLineB - First*) - string"B(*MultiLineB - Second*)""", - marker = """ing"B(*MultiLineB - Second*)""", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.ByteString_Literal() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let bytestringthree = @"literal"B(*Literal Byte*)""", - marker = """al"B(*Literal Byte*)""", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.EscapedIdentifier_word() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """let ``this is an escaped identifier 123ASDF@#$"`` = 4""", - marker = "this", - defines = [], - classificationType = ClassificationTypeNames.Identifier) - - [] - member this.EscapedIdentifier_SpecialChar() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """let ``this is an escaped identifier 123ASDF@#$"`` = 4""", - marker = "3ASDF@#", - defines = [], - classificationType = ClassificationTypeNames.Identifier) - - [] - member this.EscapedIdentifier_EscapeChar() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """let ``this is an escaped identifier 123ASDF@#$"`` = 4""", - marker = "\"``", - defines = [], - classificationType = ClassificationTypeNames.Identifier) - - /// Regression for 3609 - Colorizer: __SOURCE__ and others colorized as a string - [] - member this.PredefinedIdentifier_SOURCE_DIRECTORY() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let x = __SOURCE_DIRECTORY__(*Test1*)""", - marker = "__(*Test1*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.PredefinedIdentifier_SOURCE_FILE() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let y = __SOURCE_FILE__(*Test2*))""", - marker = "__(*Test2*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.PredefinedIdentifier_LINE() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let z = __LINE__(*Test3*)""", - marker = "__(*Test3*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - // Regression Test for FSB 3566, F# colorizer does not respect numbers - [] - member this.Number_InAnExpression() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """let f x = x + 9""", - marker = "9", - defines = [], - classificationType = ClassificationTypeNames.NumericLiteral) - - // Regression Test for FSB 1778 - Colorization seems to be confused after parsing a comment that contains a verbatim string that contains a \ - [] - member this.Number_AfterCommentWithBackSlash() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """let f (* @"\\" *)x = x + 19(*Marker1*)""", - marker = "9(*Marker1*)", - defines = [], - classificationType = ClassificationTypeNames.NumericLiteral) - - // Regression Test for FSharp1.0:2539 -- lexing @"" strings inside (* *) comments? - [] - member this.Keyword_AfterCommentWithLexingStrings() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - (* - let x = @"\\" - *) - - let(*Marker1*) y = 1 - """, - marker = "t(*Marker1*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - // Regression Test for FSB 1380 - Language Service colorizes anything followed by a bang as a keyword - [] - member this.Keyword_LetBang() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let seqExpr = - seq { - let! x = [1 .. 10](*Marker1*) - yield! x(*Marker2*) - do! - = ()(*Marker3*) - }""", - marker = "! x = [1 .. 10](*Marker1*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_Yield() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let seqExpr = - seq { - let! x = [1 .. 10](*Marker1*) - yield! x(*Marker2*) - do! - = ()(*Marker3*) - }""", - marker = "! x(*Marker2*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_Do() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let seqExpr = - seq { - let! x = [1 .. 10](*Marker1*) - yield! x(*Marker2*) - do! - = ()(*Marker3*) - }""", - marker = "! - = ()(*Marker3*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_Invalid_Bang() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let seqExpr = - seq { - foo! = true(*Marker1*) - }""", - marker = "! = true(*Marker1*)", - defines = [], - classificationType = ClassificationTypeNames.Identifier) - - [] - [] - [] - //This test case Verify that the color of const is the keyword color - member this.TypeProvider_StaticParameters_Keyword_const() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - type foo = N1.T< const(*Marker1*) "Hello World",2>""", - marker = "t(*Marker1*)", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - // Regression test for FSB 3696 - Colorization doesn't treat #if/else/endif correctly when embedded in a string literal - [] - member this.PreProcessor_InStringLiteral01() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED - let x = "#elseMarker1" - let y = "#endifMarker2" - #else//Marker3 - let x = "#elseMarker4" - let y = "#endifMarker5" - #endif""", - marker = "eMarker1", - defines = [], - classificationType = ClassificationTypeNames.ExcludedCode) - - [] - member this.PreProcessor_InStringLiteral02() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED - let x = "#elseMarker1" - let y = "#endifMarker2" - #else//Marker3 - let x = "#elseMarker4" - let y = "#endifMarker5" - #endif""", - marker = "fMarker2", - defines = [], - classificationType = ClassificationTypeNames.ExcludedCode) - - [] - member this.PreProcessor_ElseKeyword() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED - let x = "#elseMarker1" - let y = "#endifMarker2" - #else//Marker3 - let x = "#elseMarker4" - let y = "#endifMarker5" - #endif""", - marker = "e//Marker3", - defines = [], - classificationType = ClassificationTypeNames.PreprocessorKeyword) - - [] - member this.PreProcessor_InStringLiteral03() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED - let x = "#elseMarker1" - let y = "#endifMarker2" - #else//Marker3 - let x = "#elseMarker4" - let y = "#endifMarker5" - #endif""", - marker = "eMarker4", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - [] - member this.PreProcessor_InStringLiteral04() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED - let x = "#elseMarker1" - let y = "#endifMarker2" - #else//Marker3 - let x = "#elseMarker4" - let y = "#endifMarker5" - #endif""", - marker = "fMarker5", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - // Regression test for FSHARP1.0:4279 - [] - member this.Keyword_OCaml_asr() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(asr, b) -> () - |_ -> ()""", - marker = "asr", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_land() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(land, b) -> () - |_ -> ()""", - marker = "land", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_lor() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(lor, b) -> () - |_ -> ()""", - marker = "lor", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_lsl() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(lsl, b) -> () - |_ -> ()""", - marker = "lsl", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_lsr() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(lsr, b) -> () - |_ -> ()""", - marker = "lsr", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_lxor() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(lxor, b) -> () - |_ -> ()""", - marker = "lxor", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_mod() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(mod, b) -> () - |_ -> ()""", - marker = "mod", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - member this.Keyword_OCaml_sig() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - let foo a = - match a with - | Some(sig, b) -> () - |_ -> ()""", - marker = "sig", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - member this.InactiveCode(marker: string, classificationType: string) = - let fileContents = """ - #if UNDEFINED - (*Inactive Code1*)let notLegit1 x = x - #else - #if UNDEFINED - (*Inactive Code2*)let notLegit2 x = x - #else - #if UNDEFINED - (*Inactive Code3*)let notLegit3 x = x - #else - #if UNDEFINED - (*Inactive Code4*)let notLegit4 x = x - #else - #if UNDEFINED - (*Inactive Code5*)let notLegit5 x = x - #else - (*Active Code5*)let legitCode5 x = x - #endif - (*Active Code4*)let legitCode4 x = x - #endif - (*Active Code3*)let legitCode3 x = x - #endif - - (*Active Code2*)let legitCode2 x = x - #endif - (*Active Code1*)let legitCode1 x = x - #endif - - #if DEFINED - (*Active Code6*)let legitCode6 x = x - #if DEFINED - (*Active Code7*)let legitCode7 x = x - #else - (*Inactive Code7*)let notLegit7 x = x - #endif - #else - (*Inactive Code6*)let notLegit6 x = x - #endif - """ - - this.VerifyColorizerAtEndOfMarker(fileContents, marker, ["DEFINED"], classificationType) - - - [] - member public this.Colorizer_AtString() = - this.VerifyColorizerAtEndOfMarker("let s = @\"Bob\"", - marker = "let s = @\"B", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - - [] - [] - [] - member public this.Regression_Bug4860(marker: string, classificationType: string) = - this.VerifyColorizerAtStartOfMarker( - fileContents = " - let x = __SOURCE_DIRECTORY__(*Test1*) - let y = __SOURCE_FILE__(*Test2*) - let z = __LINE__(*Test3*)", - marker = marker, - defines = [], - classificationType = classificationType) - - - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - member public this.Number_Regression_Bug3566(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "let n = 123 - let l = [12..15] - let l2 = [12 .. 15] - let l3 = [ 12 .. 15 ] - // comment1: 1234 - (* comment2: 1234 *) - let other = 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4.0, 4.0f, 4N, 4I, 1M, 123", - marker = marker, - defines = [], - classificationType = classificationType) - - - /// FEATURE: Hash commands in .fsx files are colorized in PreprocessorKeyword color - [] - member public this.Preprocessor_InFsxFile_StartOfMarker(marker: string, classificationType: string) = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#reference @\"\" - #load @\"\" - #I <--hash I - #time @\"\"", - marker = marker, - defines = [], - classificationType = classificationType, - isScriptFile = true) - - - /// FEATURE: Hash commands in .fsx files are colorized in PreprocessorKeyword color - [] - [] - [] - member public this.Preprocessor_InFsxFile_EndOfMarker(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "#reference @\"\" - #load @\"\" - #I <--hash I - #time @\"\"", - marker = marker, - defines = [], - classificationType = classificationType, - isScriptFile = true) - - - /// FEATURE: Script-specific hash commands do not show up in blue in .fs files. - [] - member public this.Preprocessor_InFsFile_StartOfMarker(marker: string, classificationType: string) = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#reference @\"\" - #load @\"\" - #I <--hash I - #time @\"\"", - marker = marker, - defines = [], - classificationType = classificationType) - - - /// FEATURE: Script-specific hash commands do not show up in blue in .fs files. - [] - [] - [] - member public this.Preprocessor_InFsFile_EndOfMarker(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "#reference @\"\" - #load @\"\" - #I <--hash I - #time @\"\"", - marker = marker, - defines = [], - classificationType = classificationType) - - /// FEATURE: Nested (* *) comments are allowed and will be colorized with CommentColor. Only the final *) causes the comment to close. - [] - [] - [] - member public this.Comment_AfterCommentBlock(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "(*Bob*)type Bob() = class end - (* - (* - (*Alice*)type Alice() = class end - *) - *) - (*Charles*)type Charles() = class end", - marker = marker, - defines = [], - classificationType = classificationType) - - - /// BUG: The comment used to be colored in black. - [] - member public this.Regression_Bug1596() = - this.VerifyColorizerAtEndOfMarker( - fileContents = " let 2d (* Identifiers cannot start with numbers *)", - marker = "let 2d (* Ide", - defines = [], - classificationType = ClassificationTypeNames.Comment) - - - /// FEATURE: Code inside #if\#else\#endif blocks is colored with InactiveCodeColor depending on defines. This works for nested #if blocks as well. - [] - [] - [] - [] - [] - [] - member public this.Preprocessor_AfterPreprocessorBlock(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "(*Bob*)type Bob() = class end - #if UNDEFINED - #if UNDEFINED - (*Alice*)type Alice() = class end - #else - (*Tom*)type Tom() = class end - #endif - #else - #if UNDEFINED - (*Maurice*)type Maurice() = class end - #else - (*Larry*)type Larry() = class end - #endif - #endif - (*Charles*)type Charles() = class end", - marker = marker, - defines = [], - classificationType = classificationType) - - - // Wrong "#else" in "#if" should be ignored - [] - [] - member public this.Preprocessor_InvalidElseDirectiveIgnored(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "#if UNDEFINED - (*Alice*)type Alice() = class end - (**) #else - (*Larry*)type Larry() = class end - #endif", - marker = marker, - defines = [], - classificationType = classificationType) - - - /// FEATURE: Code inside #if\#else\#endif blocks is colored with InactiveCodeColor depending on defines. This works for nested #if blocks as well. - [] - [] - [] - [] - [] - [] - member public this.Preprocessor_AfterPreprocessorBlockWithDefines(marker: string, classificationType: string) = - this.VerifyColorizerAtEndOfMarker( - fileContents = - "(*Bob*)type Bob() = class end - #if UNDEFINED - #if UNDEFINED - (*Alice*)type Alice() = class end - #else - (*Tom*)type Tom() = class end - #endif - #else - #if UNDEFINED - (*Maurice*)type Maurice() = class end - #else - (*Larry*)type Larry() = class end - #endif - #endif - (*Charles*)type Charles() = class end", - marker = marker, - defines = [], - classificationType = classificationType) - - - /// FEATURE: Preprocessor keywords #light\#if\#else\#endif are colored with the PreprocessorKeyword color. - /// FEATURE: All code in the inactive side of #if\#else\#endif is colored with with InactiveCode color. - [] - [] - [] - [] - [] - [] - [] - [] - [] - [] - member public this.Preprocessor_Keywords(marker: string, classificationType: string) = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#light (*Light*) - #if UNDEFINED //(*If*) - let x = 1(*Inactive*) - #else //(*Else*) - let(*Active*) x = 1 - #endif //(*Endif*)", - marker = marker, - defines = [], - classificationType = classificationType) - - - /// FEATURE: Preprocessor extended grammar basic check. - /// FEATURE: More extensive grammar test is done in compiler unit tests - [] - member public this.Preprocesso_ExtendedIfGrammar_Basic01() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED || !UNDEFINED // Extended #if - let x = "activeCode" - #else - let x = "inactiveCode" - #endif - """, - marker = "activeCode", - defines = [], - classificationType = ClassificationTypeNames.StringLiteral) - - - [] - member public this.Preprocessor_ExtendedIfGrammar_Basic02() = - this.VerifyColorizerAtStartOfMarker( - fileContents = """ - #if UNDEFINED || !UNDEFINED // Extended #if - let x = "activeCode" - #else - let x = "inactiveCode" - #endif - """, - marker = "inactiveCode", - defines = [], - classificationType = ClassificationTypeNames.ExcludedCode) - - - /// #else / #endif in multiline strings is ignored - [] - member public this.Preprocessor_DirectivesInString() = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#light - - #if DEFINED - let s = \" - #else - \" - let testme = 1 - #endif", - marker = "let testme", - defines = ["DEFINED"], - classificationType = ClassificationTypeNames.Keyword) - - - /// Bug 2076 - String literals were causing the endif stack information to be discarded - [] - [] - [] - member public this.Preprocessor_KeywordsWithStrings(marker: string, classificationType: string) = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#light (*Light*) - let x1 = \"string1\" - #if UNDEFINED //(*If*) - let x2 = \"string2\" - #else //(*Else*) - let x3 = \"string3\" - #endif //(*Endif*) - let x4 = \"string4\"", - marker = marker, - defines = [], - classificationType = classificationType) - - - [] - member public this.Comment_VerbatimStringInComment_Bug1778() = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#light - (* @\"\\\" *) let a = 0", - marker = "le", - defines = [], - classificationType = ClassificationTypeNames.Keyword) - - - [] - member public this.Preprocessor_KeywordsWrongIf_Bug1577() = - this.VerifyColorizerAtStartOfMarker( - fileContents = - "#if !!!!!!!!!!!!!!!COMPILED - #endif", - marker = "!!COMPILED", - defines = [], - classificationType = ClassificationTypeNames.Identifier) - - - // This was an off-by-one bug in the replacement Colorizer - [] - member public this.Keyword_LastCharacterOfKeyword() = - this.VerifyColorizerAtEndOfMarker( - fileContents = "(*Bob*)type Bob() = int", - marker = "(*Bob*)typ", - defines = [], - classificationType = ClassificationTypeNames.Keyword) \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/app.runsettings b/fcs/FSharp.Compiler.Service.Tests/app.runsettings deleted file mode 100644 index 009d9b6977..0000000000 --- a/fcs/FSharp.Compiler.Service.Tests/app.runsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 1 - - - diff --git a/fcs/FSharp.Compiler.Service.sln b/fcs/FSharp.Compiler.Service.sln deleted file mode 100644 index 03f557f601..0000000000 --- a/fcs/FSharp.Compiler.Service.sln +++ /dev/null @@ -1,143 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29418.71 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{B6B68AE6-E7A4-4D43-9B34-FFA74BFE192B}" - ProjectSection(SolutionItems) = preProject - build.cmd = build.cmd - build.fsx = build.fsx - build.sh = build.sh - paket.dependencies = paket.dependencies - README.md = README.md - RELEASE_NOTES.md = RELEASE_NOTES.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docsrc", "docsrc", "{83FEE492-6701-4E59-9184-16B1D30E91F8}" - ProjectSection(SolutionItems) = preProject - docsrc\content\caches.fsx = docsrc\content\caches.fsx - docsrc\content\corelib.fsx = docsrc\content\corelib.fsx - docsrc\content\devnotes.md = docsrc\content\devnotes.md - docsrc\content\editor.fsx = docsrc\content\editor.fsx - docsrc\content\filesystem.fsx = docsrc\content\filesystem.fsx - docsrc\content\fsharp-readme.md = docsrc\content\fsharp-readme.md - docsrc\content\index.md = docsrc\content\index.md - docsrc\content\interactive.fsx = docsrc\content\interactive.fsx - docsrc\content\project.fsx = docsrc\content\project.fsx - docsrc\content\queue.fsx = docsrc\content\queue.fsx - docsrc\content\symbols.fsx = docsrc\content\symbols.fsx - docsrc\content\tokenizer.fsx = docsrc\content\tokenizer.fsx - docsrc\content\typedtree.fsx = docsrc\content\typedtree.fsx - docsrc\content\untypedtree.fsx = docsrc\content\untypedtree.fsx - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{0554567F-1DCB-46A5-9EF2-E1938A3D4F14}" - ProjectSection(SolutionItems) = preProject - docsrc\tools\generate.fsx = docsrc\tools\generate.fsx - docsrc\tools\templates\template.cshtml = docsrc\tools\templates\template.cshtml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E396742E-B4E5-4584-A9E4-CC1A491F5BC1}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "EditorService", "samples\EditorService\EditorService.fsproj", "{A40507D6-FA48-43D3-B18A-AE3DAACE4020}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "InteractiveService", "samples\InteractiveService\InteractiveService.fsproj", "{067E95E5-E3DC-4CA7-813A-4D1E277D2D52}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Tokenizer", "samples\Tokenizer\Tokenizer.fsproj", "{92793069-816F-4F69-84AC-0966F8275E65}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "UntypedTree", "samples\UntypedTree\UntypedTree.fsproj", "{C816728D-BBEA-472D-9F6C-E8913957A673}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FscExe", "samples\FscExe\FscExe.fsproj", "{C94C257C-3C0A-4858-B5D8-D746498D1F08}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp_Analysis", "FSharp.Compiler.Service.Tests\CSharp_Analysis\CSharp_Analysis.csproj", "{887630A3-4B1D-40EA-B8B3-2D842E9C40DB}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FsiExe", "samples\FsiExe\FsiExe.fsproj", "{F9540CA8-1CE0-4546-A23A-A461E416E95B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{098D1C35-D0FB-4720-83DD-8002293EA237}" - ProjectSection(SolutionItems) = preProject - .gitattributes = .gitattributes - .gitignore = .gitignore - .travis.yml = .travis.yml - appveyor.yml = appveyor.yml - NuGet.Config = NuGet.Config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{9020E136-794A-473F-9B1B-9623C97B7161}" - ProjectSection(SolutionItems) = preProject - nuget\FSharp.Compiler.Service.template = nuget\FSharp.Compiler.Service.template - EndProjectSection -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.MSBuild.v12", "FSharp.Compiler.Service.MSBuild.v12\FSharp.Compiler.Service.MSBuild.v12.fsproj", "{8157B50E-397D-4232-A4E0-1977AFC7076D}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.Tests", "FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DependencyManager.Nuget", "..\src\fsharp\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj", "{C75A2B88-DA11-4DF7-826F-92E6CDBA47BD}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Release|Any CPU.Build.0 = Release|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Debug|Any CPU.Build.0 = Debug|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Release|Any CPU.ActiveCfg = Release|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Release|Any CPU.Build.0 = Release|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Release|Any CPU.Build.0 = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Any CPU.Build.0 = Release|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.Build.0 = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.Build.0 = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Release|Any CPU.Build.0 = Release|Any CPU - {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|Any CPU.Build.0 = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.Build.0 = Release|Any CPU - {C75A2B88-DA11-4DF7-826F-92E6CDBA47BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C75A2B88-DA11-4DF7-826F-92E6CDBA47BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C75A2B88-DA11-4DF7-826F-92E6CDBA47BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C75A2B88-DA11-4DF7-826F-92E6CDBA47BD}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {0554567F-1DCB-46A5-9EF2-E1938A3D4F14} = {83FEE492-6701-4E59-9184-16B1D30E91F8} - {A40507D6-FA48-43D3-B18A-AE3DAACE4020} = {E396742E-B4E5-4584-A9E4-CC1A491F5BC1} - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52} = {E396742E-B4E5-4584-A9E4-CC1A491F5BC1} - {92793069-816F-4F69-84AC-0966F8275E65} = {E396742E-B4E5-4584-A9E4-CC1A491F5BC1} - {C816728D-BBEA-472D-9F6C-E8913957A673} = {E396742E-B4E5-4584-A9E4-CC1A491F5BC1} - {C94C257C-3C0A-4858-B5D8-D746498D1F08} = {E396742E-B4E5-4584-A9E4-CC1A491F5BC1} - {F9540CA8-1CE0-4546-A23A-A461E416E95B} = {E396742E-B4E5-4584-A9E4-CC1A491F5BC1} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9E9BAC7B-3834-497C-B7AC-6B7988778D1A} - EndGlobalSection -EndGlobal diff --git a/fcs/FSharp.Compiler.Service.sln.DotSettings b/fcs/FSharp.Compiler.Service.sln.DotSettings deleted file mode 100644 index 59e0b85499..0000000000 --- a/fcs/FSharp.Compiler.Service.sln.DotSettings +++ /dev/null @@ -1,780 +0,0 @@ - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True~ \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service/.gitignore b/fcs/FSharp.Compiler.Service/.gitignore deleted file mode 100644 index 722f2e9b83..0000000000 --- a/fcs/FSharp.Compiler.Service/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -net4*/ -netstandard*/ diff --git a/fcs/FSharp.Compiler.Service/AssemblyInfo.fs b/fcs/FSharp.Compiler.Service/AssemblyInfo.fs deleted file mode 100644 index 90521fefd5..0000000000 --- a/fcs/FSharp.Compiler.Service/AssemblyInfo.fs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.FSharp -open System.Reflection -open System.Runtime.InteropServices - -[] -[] -[] -[] -[] -[] - -#if NO_STRONG_NAMES -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] - -// Note: internals visible to unit test DLLs in Retail (and all) builds. -[] -[] -[] -[] -[] -#endif - -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] -[] - -// Until dotnet sdk can version assemblies, use this -#if BUILD_FROM_SOURCE -[] -[] -[] -#endif - -do() \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj deleted file mode 100644 index 2264357ff1..0000000000 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ /dev/null @@ -1,756 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\..\src - - - - - - $(FcsTargetNetFxFramework);netstandard2.0 - true - $(DefineConstants);COMPILER_SERVICE_AS_DLL - $(DefineConstants);COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT - $(DefineConstants);NO_STRONG_NAMES - $(TargetFramework)\ - $(TargetFramework)\ - $(OtherFlags) /warnon:1182 - $(OtherFlags) --times - $(NoWarn);44;62;69;65;54;61;75;62;9;2003;NU5125 - true - true - true - embedded - 16.6 - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - - - The F# compiler as library. For editors, for tools, for scripting. For you. - The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications. - false - F# community contributors - Microsoft Corporation; F# community contributors - MIT - https://github.com/fsharp/FSharp.Compiler.Service - logo.png - F#, fsharp, interactive, compiler, editor - true - true - - - $(DefineConstants);FX_NO_PDB_READER - $(DefineConstants);FX_NO_PDB_WRITER - $(DefineConstants);FX_NO_SYMBOLSTORE - $(DefineConstants);FX_NO_APP_DOMAINS - $(DefineConstants);FX_NO_WIN_REGISTRY - $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION - $(DefineConstants);FX_RESHAPED_REFEMIT - - - - - AssemblyInfo/AssemblyInfo.fs - - - FSComp.txt - - - DependencyManager.txt - - - FSIstrings.txt - - - FSStrings.resx - FSStrings.resources - - - --module FSharp.Compiler.AbstractIL.Internal.AsciiParser --open FSharp.Compiler.AbstractIL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - ilpars.fsy - - - --module FSharp.Compiler.Parser --open FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - pars.fsy - - - Logger.fsi - - - Logger.fs - - - ErrorText/sformat.fsi - - - ErrorText/sformat.fs - - - ErrorText/sr.fsi - - - ErrorText/sr.fs - - - Driver\LanguageFeatures.fsi - - - Driver\LanguageFeatures.fs - - - LexYaccRuntime/prim-lexing.fsi - - - LexYaccRuntime/prim-lexing.fs - - - LexYaccRuntime/prim-parsing.fsi - - - LexYaccRuntime/prim-parsing.fs - - - Utilities/PathMap.fsi - - - Utilities/PathMap.fs - - - Utilities/ResizeArray.fsi - - - Utilities/ResizeArray.fs - - - Utilities/HashMultiMap.fsi - - - Utilities/HashMultiMap.fs - - - Utilities/EditDistance.fs - - - Utilities/TaggedCollections.fsi - - - Utilities/TaggedCollections.fs - - - Utilities/QueueList.fs - - - Utilities/ildiag.fsi - - - Utilities/ildiag.fs - - - Utilities/illib.fs - - - Utilities/filename.fsi - - - Utilities/filename.fs - - - Utilities/zmap.fsi - - - Utilities/zmap.fs - - - Utilities/zset.fsi - - - Utilities/zset.fs - - - Utilities/bytes.fsi - - - Utilities/bytes.fs - - - Utilities\XmlAdapters.fs - - - Utilities/lib.fs - - - Utilities/InternalCollections.fsi - - - Utilities/InternalCollections.fs - - - Utilities/rational.fsi - - - Utilities/rational.fs - - - ErrorLogging/range.fsi - - - ErrorLogging/range.fs - - - ErrorLogging/ErrorLogger.fs - - - ErrorLogging/ErrorResolutionHints.fs - - - --unicode --lexlib Internal.Utilities.Text.Lexing - AbsIL/illex.fsl - - - AbsIL/il.fsi - - - AbsIL/il.fs - - - AbsIL/ilx.fsi - - - AbsIL/ilx.fs - - - AbsIL/ilascii.fsi - - - AbsIL/ilascii.fs - - - AbsIL/ilprint.fsi - - - AbsIL/ilprint.fs - - - AbsIL/ilmorph.fsi - - - AbsIL/ilmorph.fs - - - - - AbsIL/ilsign.fs - - - - - AbsIL/ilnativeres.fsi - - - AbsIL/ilnativeres.fs - - - AbsIL/ilsupp.fsi - - - AbsIL/ilsupp.fs - - - AbsIL/ilpars.fs - - - AbsIL/illex.fs - - - AbsIL/ilbinary.fsi - - - AbsIL/ilbinary.fs - - - AbsIL/ilread.fsi - - - AbsIL/ilread.fs - - - AbsIL/ilwritepdb.fsi - - - AbsIL/ilwritepdb.fs - - - AbsIL/ilwrite.fsi - - - AbsIL/ilwrite.fs - - - AbsIL/ilreflect.fs - - - ReferenceResolution/ReferenceResolver.fs - - - ReferenceResolution/SimulatedMSBuildReferenceResolver.fs - - - - CompilerLocation/CompilerLocationUtils.fs - - - PrettyNaming/PrettyNaming.fs - - - ILXErase/ilxsettings.fs - - - ILXErase/EraseClosures.fsi - - - ILXErase/EraseClosures.fs - - - ILXErase/EraseUnions.fsi - - - ILXErase/EraseUnions.fs - - - --unicode --lexlib Internal.Utilities.Text.Lexing - ParserAndUntypedAST/lex.fsl - - - --unicode --lexlib Internal.Utilities.Text.Lexing - ParserAndUntypedAST/pplex.fsl - - - --module FSharp.Compiler.PPParser --open FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - ParserAndUntypedAST/pppars.fsy - - - ParserAndUntypedAST/UnicodeLexing.fsi - - - ParserAndUntypedAST/UnicodeLexing.fs - - - ParserAndUntypedAST/layout.fsi - - - ParserAndUntypedAST/layout.fs - - - ParserAndUntypedAST/XmlDoc.fs - - - ParserAndUntypedAST/SyntaxTree.fs - - - ParserAndUntypedAST/SyntaxTreeOps.fs - - - ParserAndUntypedAST/ParseHelpers.fs - - - ParserAndUntypedAST/pppars.fs - - - ParserAndUntypedAST/pars.fs - - - ParserAndUntypedAST/lexhelp.fsi - - - ParserAndUntypedAST/lexhelp.fs - - - ParserAndUntypedAST/pplex.fs - - - ParserAndUntypedAST/lex.fs - - - ParserAndUntypedAST/LexFilter.fs - - - TypedTree/tainted.fsi - - - TypedTree/tainted.fs - - - TypedTree/ExtensionTyping.fsi - - - TypedTree/ExtensionTyping.fs - - - TypedTree/QuotationPickler.fsi - - - TypedTree/QuotationPickler.fs - - - TypedTree/CompilerGlobalState.fs - - - TypedTree/TypedTree.fs - - - TypedTree/TypedTreeBasics.fs - - - TypedTree/TcGlobals.fs - - - TypedTree/TypedTreeOps.fsi - - - TypedTree/TypedTreeOps.fs - - - TypedTree/TypedTreePickle.fsi - - - TypedTree/TypedTreePickle.fs - - - Logic/import.fsi - - - Logic/import.fs - - - Logic/infos.fs - - - Logic/AccessibilityLogic.fs - - - Logic/AttributeChecking.fs - - - Logic/TypeRelations.fs - - - Logic/InfoReader.fs - - - Logic/NicePrint.fs - - - Logic/AugmentWithHashCompare.fsi - - - Logic/AugmentWithHashCompare.fs - - - Logic/NameResolution.fsi - - - Logic/NameResolution.fs - - - Logic/SignatureConformance.fs - - - Logic/MethodOverrides.fs - - - Logic/MethodCalls.fs - - - Logic/PatternMatchCompilation.fsi - - - Logic/PatternMatchCompilation.fs - - - Logic/ConstraintSolver.fsi - - - Logic/ConstraintSolver.fs - - - Logic/CheckFormatStrings.fsi - - - Logic/CheckFormatStrings.fs - - - Logic/FindUnsolved.fsi - - - Logic/FindUnsolved.fs - - - Logic/QuotationTranslator.fsi - - - Logic/QuotationTranslator.fs - - - Logic/PostInferenceChecks.fsi - - - Logic/PostInferenceChecks.fs - - - Logic/TypeChecker.fsi - - - Logic/TypeChecker.fs - - - Optimize/Optimizer.fsi - - - Optimize/Optimizer.fs - - - Optimize/DetupleArgs.fsi - - - Optimize/DetupleArgs.fs - - - Optimize/InnerLambdasToTopLevelFuncs.fsi - - - Optimize/InnerLambdasToTopLevelFuncs.fs - - - Optimize/LowerCallsAndSeqs.fsi - - - Optimize/LowerCallsAndSeqs.fs - - - Optimize/autobox.fsi - - - Optimize/autobox.fs - - - CodeGen/IlxGen.fsi - - - CodeGen/IlxGen.fs - - - Driver\DotNetFrameworkDependencies.fs - - - Driver\AssemblyResolveHandler.fsi - - - Driver\AssemblyResolveHandler.fs - - - Driver\NativeDllResolveHandler.fsi - - - Driver\NativeDllResolveHandler.fs - - - Driver/DependencyProvider.fsi - - - Driver/DependencyProvider.fsi - - - Driver/DependencyProvider.fs - - - Driver/CompileOps.fsi - - - Driver/CompileOps.fs - - - Driver/CompileOptions.fsi - - - Driver/CompileOptions.fs - - - Driver/fsc.fsi - - - Driver/fsc.fs - - - Symbols/SymbolHelpers.fsi - - - Symbols/SymbolHelpers.fs - - - Symbols/Symbols.fsi - - - Symbols/Symbols.fs - - - Symbols/Exprs.fsi - - - Symbols/Exprs.fs - - - Symbols/SymbolPatterns.fsi - - - Symbols/SymbolPatterns.fs - - - Service/Reactor.fsi - - - Service/Reactor.fs - - - Service/SemanticClassification.fsi - - - Service/SemanticClassification.fs - - - Service/ItemKey.fsi - - - Service/ItemKey.fs - - - Service/IncrementalBuild.fsi - - - Service/IncrementalBuild.fs - - - Service/ServiceConstants.fs - - - Service/ServiceLexing.fsi - - - Service/ServiceLexing.fs - - - Service/ServiceParseTreeWalk.fs - - - Service/ServiceNavigation.fsi - - - Service/ServiceNavigation.fs - - - Service/ServiceParamInfoLocations.fsi - - - Service/ServiceParamInfoLocations.fs - - - Service/ServiceUntypedParse.fsi - - - Service/ServiceUntypedParse.fs - - - Service/ServiceDeclarationLists.fsi - - - Service/ServiceDeclarationLists.fs - - - Service/ServiceAssemblyContent.fsi - - - Service/ServiceAssemblyContent.fs - - - Service/ServiceXmlDocParser.fsi - - - Service/ServiceXmlDocParser.fs - - - Service/ExternalSymbol.fsi - - - Service/ExternalSymbol.fs - - - Service/QuickParse.fsi - - - Service/QuickParse.fs - - - Service/FSharpCheckerResults.fsi - - - Service/FSharpCheckerResults.fs - - - Service/service.fsi - - - Service/service.fs - - - Service/ServiceInterfaceStubGenerator.fsi - - - Service/ServiceInterfaceStubGenerator.fs - - - Service/ServiceStructure.fsi - - - Service/ServiceStructure.fs - - - Service/ServiceAnalysis.fsi - - - Service/ServiceAnalysis.fs - - - Service/fsi.fsi - - - Service/fsi.fs - - - - - - - - - - - - - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - - diff --git a/fcs/README.md b/fcs/README.md deleted file mode 100644 index 5f54c58793..0000000000 --- a/fcs/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# The FSharp.Compiler.Service components and NuGet package - -This directory contains the build, packaging, test and documentation-generation logic for the NuGet package ``FSharp.Compiler.Service``. The source for this NuGet -package is in ``..\src``. - -Basically we are packaging up the compiler as a DLL and publishing it as a NuGet package. - -## FSharp.Compiler.Service v. FSharp.Compiler.Private - -There are subtle differences between FSharp.Compiler.Service and FSharp.Compiler.Private (shipped with the Visual F# Tools) - -- FCS has a public API - -- FCS is built against **.NET 4.6.1** and **FSharp.Core NuGet 4.6.2** to give broader reach - -- FCS has a NuGet package - -- FCS has a .NET Standard 2.0 version in the nuget package - -- FCS doesn't add the System.ValueTuple.dll reference by default, see ``#if COMPILER_SERVICE_AS_DLL`` in compiler codebase - -## Version Numbers - -FCS uses its own version number sequence for assemblies and packages, approximately following SemVer rules. -To update the version number a global replace through fcs\... is currently needed, e.g. - - Directory.Build.props - nuget/FSharp.Compiler.Service.nuspec - nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec - RELEASE_NOTES.md - -## Building, Testing, Packaging, Releases - -To build the package use any of: - - fcs\build Build.NetFx - fcs\build Test.NetFx - fcs\build NuGet.NetFx - - fcs\build Build.NetStd - fcs\build Test.NetStd - fcs\build NuGet.NetStd - - fcs\build Build - fcs\build Test - fcs\build NuGet - fcs\build Release - -which does things like: - - cd fcs - .paket\paket.bootstrapper.exe - .paket\paket.exe restore - dotnet restore tools.proj - packages\FAKE\tools\FAKE.exe build.fsx WhateverTarget - -### Manual push of packages - -You can push the packages if you have permissions, either automatically using ``build Release`` or manually - - set APIKEY=... - ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.33.0.1.nupkg %APIKEY% -Source https://nuget.org - ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.MSBuild.v12.33.0.1.nupkg %APIKEY% -Source https://nuget.org - -### Use of Paket and FAKE - -Paket is only used to get FAKE and FSharp.Formatting tools. Eventually we will likely remove this once we update the project files to .NET SDK 2.0. - -FAKE is only used to run build.fsx. Eventually we will likely remove this once we update the project files to .NET SDK 2.0. - -### Testing - -Testing reuses the test files from ..\tests\service which were are also FCS tests. - -### Documentation Generation - - fcs\build GenerateDocs - -Output is in ``docs``. In the ``FSharp.Compiler.Service`` repo this is checked in and hosted as . - -## Other NuGet packages - -It also contains both the source, build, packaging and test logic for - -- ``FSharp.Compiler.Service.MSBuild.v12`` adds legacy MSBuild v12 support to an instance of FSharp.Compiler.Service, if exact compatibility for scripting references such as ``#r "Foo, Version=1.3.4"`` is required. - -These components are gradually becoming obsolete - -## Engineering road map - -FSharp.Compiler.Service is a somewhat awkward component. There are some things we can do to simplify things: - -1. Remove the use of Paket and FAKE -1. Move all projects under fcs\... to new .NET SDK project file format -1. Drop the use of ``dotnet mergenupkg`` since we should be able to use cross targeting -1. Make FCS a DLL similar to the rest of the build and make this an official component from Microsoft (signed etc.) -1. Replace FSharp.Compiler.Private by FSharp.Compiler.Service diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md deleted file mode 100644 index a369172506..0000000000 --- a/fcs/RELEASE_NOTES.md +++ /dev/null @@ -1,857 +0,0 @@ -#### 37.0.0 - -This release bring a number of new changes, including a massive enhancement to SemanticClassification types thanks to @cartermp. - -From dotnet/fsharp:333eb82c8..d9e070a9d: - -* now allows for multiple implementations of generic interfaces (preview feature) (thanks @0x53A!) -* the default assembly set for script resolution now includes System.Numerics (thanks @KevinRansom) -* #r nuget package resolution is now committed eagerly, instead of delayed (thanks @KevinRansom) -* reduced allocations for some strings in the compiler (thanks @kerams) -* better printing for SRTP constraints (thanks @abelbraaksma/@realvictorprm) -* more expressive DUs for semantic classification (thanks @cartermp) -* remove legacymsbuildreferenceresolver (thanks @KevinRandom) -* supply witnesses for op_UnaryPlus (thanks @TIHan) -* clean up CE classifications (thanks @cartermp) -* Fixed tostring/equality for StringText (thanks @deviousasti) -* Fixed error text for FS0874 -* Disallow assignment to C# Const/Readonly properties (thanks @baronfel) -* Allow Int64.MinValue as a valid nativeint literal (thanks @abelbraaksma) -* Enhancements to the nameof feature (preview feature) -* String interpolation (preview feature) - -#### 36.0.3 - -This is a small bugfix release that fixes a nuspec package dependency issue with Sourcelink - -#### 36.0.2 - -This is a small bugfix release that I'm making primarily to publish a version -of FCS with sourcelink enabled, so that tooling users can make use of that information. - -From dotnet/fsharp:079276b4b..37d0cccec: - -* Fixes for `do!` handling in computation expressions (thanks @baronfel) -* Add missing versions in FCS' Interactive header (thanks @nightroman) -* Support `Source`-translation in `match!` expressions (thanks @baronfel) -* Ensure stack traces from uncaught exceptions in CEs are maintained (thanks @NinoFloris) -* Better handling of `inline` in witness-passing codepaths (thanks @dsyme) -* Enable publishing of FCS with sourcelink (thanks @baronfel) -* Extend `nameof` to support naming generic parameters (`nameof<'t>`) and instance members (`nameof(Unchecked.defaultof.Property)`) (thanks @dsyme) - -#### 36.0.1 - -From dotnet/fsharp:522dd906c..16bca5aef: - -* Fixes to attribute range parsing (thanks @auduchinok) -* Added nested exception details to Type Provider load errors (thanks @dsyme) -* Improved error messages around unknown identifiers in patterns (thanks @jbeeko) -* Better dependency probing behavior with Facade assemblies (thanks @KevinRansom) -* APIs for programmatically adding and retrieving bindings in an FSI session (thanks @TIHan) -* Optional parameter on `FSharpChecker.FindBackgroundReferencesInFile` API to allow for stale results (thanks @TIHan) -* Better tooltips for function arguments (thanks @mcon) -* Many performance tweaks to various compiler function implementations (thanks @forki) -* Typo fixes in the AST (thanks @auduchinok) -* Better IL emitted for usages of static members as System.Action (thanks @MoFtZ) -* Allow for indexers to specify a type annotation (thanks @TIHan) -* Allow languages/scripts that have no notion of upper-case to use their characters for DU identifiers (thanks @KevinRansom) -* more optimized comparison/equality for DateTime (thanks @cartermp) -* add support for `char` for the `GenericZero/GenericOne` mechanisms (thanks @Happypig375) -* enhancements for the dependencymanager's resolution for native scripts (thanks @KevinRansom) -* more consistent support for type-directed nullable parameters (thanks @dsyme) -* fix FSI's ordering of out-of-order dlls in nuget packages (thanks @KevinRansom) -* New SyntaxTree.Paren syntax node (thanks @auduchinok) -* add SRTP witness solutions (via the new `CallWithWitnesses` pattern) (thanks @dsyme) - - -#### 35.0.0 - -This version bumps the major due to API surface area changes in the AST and TAST. In addition, there's a new package for the -built-in Nuget dependency manager for FSI: FSharp.DependencyManager.Nuget - -Members are now in SyntaxTree/SyntaxTreeOps and TypedTree/TypedTreeBasics/TypedTreeOps/TypedTreePickle. - -From dotnet/fsharp:d1a3d0705..522dd906c: - -* Improved error recovery from patterns (thanks @auduchinok) -* Smaller IL Emit for unsigned 64-bit constants (thanks @teo-tsirpanis) -* Improved ProvidedTypes Type generation (thanks @DedSec256) -* Improved CodeLenses provided (thanks @realvictorprm) -* Optimize internal member calculations in PrettyNaming and items lookup (thanks @auduchinok) -* More fixes to compiler internals, ranges, etc (thanks @auduchinok) -* Support for consumption of C# Default Interfaces -* Better encapsulation of ProvidedExpr members (thanks @DedSec256) - -#### 34.1.1 - -From dotnet/fsharp:3777cd4d8..836da28c0: - -* Slight tweaks to error messages around numeric literals (Thanks @Happypig375) -* Deny taking native address of an immutable local value (Thanks @TIHan) -* Fixes to reported ranges for wildcard self-identifiers, module abbreviations, nested modules, attributes, nested types, and fields (Thanks @auduchinok) -* Better compiler error recovery for errors in constructor expressions (Thanks @auduchinok) -* Fix handling of F# Options in C# members with regards to nullable type interop (Thanks @TIHan) -* Move dependency handling of native dlls to the DependencyManager (Thanks @KevinRansom) - -#### 34.1.0 - -From dotnet/fsharp:3af8959b6..9d69b49b7: - -* set default script TFM to netcoreapp3.1 if none found -* improve C#-nullable and optional interop (RFC FS-1075) -* Add type name to `undefined name error` if known -* improve printing via %A/fsi -* misc. improvements to DependencyManager -* improve type provider support for .netcoreapp3.1 target frameworks. -* New, optimized find-all-references API with reduced memory usage. -* better error messages for failed overload resolution - -#### 34.0.1 - -Contains commits from 32b124966 to d7018737c from dotnet/fsharp. Notable changes include: - -* lowered allocations for large strings and char arrays (notably source file texts) -* improved support for byref-like rules with regards to type abbreviations -* better support for scopes in recursive modules -* better location of .net core reference assemblies -* lowered allocations for several internal compiler structures -* better error messages for anonymous record mismatches -* FSharpChecker learned how to keep background symbol uses -* Project cracker/project cracker tool were removed -* Better support for consuming C# in-ref parameters -* new services around simplifying names and finding unused declarations -* package management in scripts (in preview) -* and-bang syntax support (in preview) - -#### 33.0.1 - -Integrate dotnet/fsharp from 4f5f08320 to 7b25d7f82. Notable changes include: - -* Addition of the FsharpUnionCase.HasFields property -* FCS builds entirely on .Net Core now -* Better debug information for ranges -* Support for Literal values in signature files -* Using memory-mapped files cross-platform to read IL. - -#### 33.0.0 - -Integrate dotnet/fsharp from 48f932cf8 to 085985140. Notable changes include: - - allowing '_' as a self-identifier - events for FSI evaluation lifecycle events - enhancements to FSI return-values - fixed parsing for langversion CLI arguments - allow cancellation of FSI interactions - ToString fixes for value options - Fixes for code generation in autogenerated members for very large records - make ranges of member declarations capture the entire member - improve error recovery in the parser - improve logic for auto-detecting framework assemblies for FSI - -#### 32.0.0 - -* integrate dotnet/fsharp from e1b8537ee to 48f932cf8 -* notable changes include: - * (preview) nameof - * (preview) open static classes - * Fixed 64-bit integer literal parsing - * Better exhaustiveness checking for byte and sbyte pattern matches - * Better native resource handling - * Script-host assembly load events - -#### 31.0.0 - * Integrate dotnet/fsharp from 5a8f454a1 to 05c558a61 - * Notable changes include: - * Removal of the `Microsoft.FSharp.Compiler.SourceCodeServices` namespace - * A new API for determining if an identifier needs to be quoted is available: `FSharp.Compiler.LexHelp.Keywords.DoesIdentifierNeedQuotation` - * Enhancements to the correctness of PDBs - * Better string formatting of records and values - * More stack overflow fixes in the compiler - * Inline IL parsing error handling - * `LeafExpressionConverter` handles struct tuples - * `FSharpChecker` now can parse a file without caching: `ParseFileNoCache` - -#### 30.0.0 - * Integrate dotnet/fsharp from 25560f477 to 5a8f454a1 - * Notable improvements include: - * performance improvements - * FCS APIs for FSComp and Implement Interface - * line directive handling - * improved performance when computing quick fix suggestions - -#### 29.0.1 - * Fix versioning of the assembly - -#### 29.0.0 - * Integrate visualfsharp master from 165b736b9 (2019-03-29) to 25560f477 (2019-05-24) - * Notable improvements include: - * Improved Portable PDB debugging - * Misc IL generation fixes - * Representing inlined mutable variables in the AST - * Moving on from net46 targeting - * Fixes for anonymous record generation - * Dependency updates - * Checking for constructors in FSharpMemberOrFunctionOrValue - * Fix unused opens false positive for record fields - -#### 28.0.0 - * Integrate visualfsharp master from efb57cf56 to 8dfc02feb - * Notable improvements include: - * XmlDoc fixes for overloads - * Fixes for deterministic compilation - * Improved tail-recursion when processing large expressions - * Better tooltip detection for operators with constraints - * FSharp.Compiler.Service nuget now uses net461, netstandard2.0 and FSharp.Core 4.6.2 - * updated lexer and parser implementations to reduce stackoverflow likelihood on .net core - -#### 27.0.1 - * Integrate visualfsharp master from 5a5ca976ec296d02551e79c3eb8e8db809e4304d to 2c8497bb097d5c5d3ef12f355594873838a48494 - * Notable improvements include: - * Anonymous Record support for expressions - * Union Case Naming fixes - * Trimming of the nuget package dependencies from 26.0.1 - -#### 26.0.1 - * Integrate visualfsharp master to 99e307f3a3ef2109ba6542ffc58affe76fc0e2a0 - -#### 25.0.1 - * Integrate visualfsharp master to 15d9391e78c554f91824d2be2e69938cd811df68 - -#### 24.0.1 - * Integrate visualfsharp master to 59156db2d0a744233d1baffee7088ca2d9f959c7 - -#### 23.0.3 - * Clarify package authors - -#### 23.0.1 - * Integrate visualfsharp master to ee938a7a5cfdf4849b091087efbf64605110541f - -#### 22.0.3 - * [Add entity.DeclaringEntity](https://github.com/Microsoft/visualfsharp/pull/4633), [FCS feature request](https://github.com/fsharp/FSharp.Compiler.Service/issues/830) - -#### 22.0.2 - * Use correct version number in DLLs (needed until https://github.com/Microsoft/visualfsharp/issues/3113 is fixed) - -#### 22.0.1 - * Integrate visualfsharp master - * Includes recent memory usage reduction work for ByteFile and ILAttributes - -#### 21.0.1 - * Use new .NET SDK project files - * FSharp.Compiler.Service nuget now uses net461 and netstandard2.0 - * FSharp.Compiler.Service netstandard2.0 now supports type providers - -#### 20.0.1 - * Integrate visualfsharp master - -#### 19.0.1 - * Rename ``LogicalEnclosingEntity`` to ``ApparentEnclosingEntity`` for consistency int he F# codebase terminology. - * Rename ``EnclosingEntity`` to ``DeclaringEntity``. In the case of extension properties, ``EnclosingEntity`` was incorrectly returning the logical enclosing entity (i.e. the type the property appears to extend), and in this case ``ApparentEnclosingEntity`` should be used instead. - -#### 18.0.1 - * Integrate visualfsharp master - -#### 17.0.2 - * Integrate visualfsharp master - -#### 16.0.3 - * [File name deduplication not working with ParseAndCheckFileInProject](https://github.com/fsharp/FSharp.Compiler.Service/issues/819) - -#### 16.0.2 - * [ProjectCracker returns *.fsi files in FSharpProjectOptions.SourceFiles array](https://github.com/fsharp/FSharp.Compiler.Service/pull/812) - - * [Fix line endings in the Nuget packages descriptions](https://github.com/fsharp/FSharp.Compiler.Service/pull/811) - -#### 16.0.1 - * FSharpChecker provides non-reactor ParseFile instead of ParseFileInProject - * Add FSharpParsingOptions, GetParsingOptionsFromProjectOptions, GetParsingOptionsFromCommandLine - -#### 15.0.1 - * Integrate latest changes from visualfsharp - * Add implementation file contents to CheckFileResults - * Fix non-public API in .NET Standard 1.6 version - -#### 14.0.1 - * Integrate latest changes from visualfsharp - * Trial release for new build in fcs\... - -#### 13.0.1 - * Move docs --> docssrc - -#### 13.0.0 - * Move FSharp.Compiler.Service.MSBuild.v12.dll to a separate nuget package - -#### 12.0.8 - * Set bit on output executables correctly - -#### 12.0.7 - * Integrate visualfsharp master - -#### 12.0.6 - * [758: Fix project cracker when invalid path given](https://github.com/fsharp/FSharp.Compiler.Service/pull/758) - -#### 12.0.5 - * Remove dependency on System.ValueTuple - -#### 12.0.3 - * [De-duplicate module names again](https://github.com/fsharp/FSharp.Compiler.Service/pull/749) - -#### 12.0.2 - * De-duplicate module names - -#### 12.0.1 - * [Integrate visualfsharp and fsharp](https://github.com/fsharp/fsharp/pull/696) - -#### 11.0.10 - * [Fix F# Interactive on Mono 4.0.9+](https://github.com/fsharp/fsharp/pull/696) - -#### 11.0.9 - * [Make incremental builder counter atomic](https://github.com/fsharp/FSharp.Compiler.Service/pull/724) - * [Add IsValCompiledAsMethod to FSharpMemberOrFunctionOrValue](https://github.com/fsharp/FSharp.Compiler.Service/pull/727) - * [Check before ILTypeInfo.FromType](https://github.com/fsharp/FSharp.Compiler.Service/issues/734) - * [Transition over to dotnet cli Fsproj](https://github.com/fsharp/FSharp.Compiler.Service/issues/700) - -#### 11.0.8 - * Depend on FSharp.Core package - -#### 11.0.6 - * Fix [stack overflow exception](https://github.com/fsharp/FSharp.Compiler.Service/issues/672) - -#### 11.0.4 - * Fix [out of range exception](https://github.com/fsharp/FSharp.Compiler.Service/issues/709) - -#### 11.0.2 - * Integrate fsharp\fsharp and Microsoft\visualfsharp to 262deb017cfcd0f0d4138779ff42ede7dbf44c46 - -#### 11.0.1 - * Integrate fsharp\fsharp and Microsoft\visualfsharp to d0cc249b951374257d5a806939e42714d8a2f4c6 - -#### 10.0.3 - * [Expose assumeDotNetFramework in FSharpChecker.GetProjectOptionsFromScript](https://github.com/fsharp/FSharp.Compiler.Service/pull/699) - * [SemanticClassificationType should not be internal](https://github.com/fsharp/FSharp.Compiler.Service/pull/696) - -#### 10.0.1 - * [Adds FormatValue to FsiEvaluationSession, using the fsi object values for formatting](https://github.com/fsharp/FSharp.Compiler.Service/pull/686) - -#### 10.0.0 - * Integrate fsharp\fsharp and Microsoft\visualfsharp to c3e55bf0b10bf08790235dc585b8cdc75f71618e - * Integrate fsharp\fsharp and Microsoft\visualfsharp to 11c0a085c96a91102cc881145ce281271ac159fe - * Some API changes for structured text provision for tagged structured text - -#### 9.0.0 - * Update names of union fields in AST API - * Fix load closure for ParseAndCheckInteraction - * [Fix #631 compiler dependency on MSBuild](https://github.com/fsharp/FSharp.Compiler.Service/pull/657) - * Fixed netcore codegen on Linux - * Explicit error when cracker exe is missing - -#### 8.0.0 - * Integrate fsharp\fsharp and Microsoft\visualfsharp to c494a9cab525dbd89585f7b733ea5310471a8001 - * Then integrate to 2002675f8aba5b3576a924a2e1e47b18e4e9a83d - * [Add module values to navigable items](https://github.com/fsharp/FSharp.Compiler.Service/pull/650) - * Optionally remove dependency on MSBuild reference resolution https://github.com/fsharp/FSharp.Compiler.Service/pull/649 - * [Compiler api harmonise](https://github.com/fsharp/FSharp.Compiler.Service/pull/639) - * Various bits of work on .NET Core version (buildable from source but not in nuget package) - -#### 7.0.0 - * Integrate fsharp\fsharp and Microsoft\visualfsharp to 835b79c041f9032fceeceb39f680e0662cba92ec - -#### 6.0.2 - * [Fix #568: recognize provided expressions](https://github.com/fsharp/FSharp.Compiler.Service/pull/568) - -#### 6.0.1 - * [Fix ProjectFileNames order when getting project options from script](https://github.com/fsharp/FSharp.Compiler.Service/pull/594) - -#### 6.0.0 - * Switch to new major version on assumption integrated F# compiler changes induce API change - -#### 5.0.2 - * Integrate Microsoft\visualfsharp to 688c26bdbbfc766326fc45e4d918f87fcba1e7ba. F# 4.1 work - -#### 5.0.1 -* [Fixed dependencies in nuget package](https://github.com/fsharp/FSharp.Compiler.Service/pull/608) - -#### 5.0.0 -* Fixed empty symbol declared pdb #564 from kekyo/fix-empty-pdb -* .NET Core ProjectCracker - updated version and dependencies -* Properly embed 'FSIstrings' resource, fixes #591 -* make build.sh work on windows (git bash). -* Added default script references for .NET Core -* Store useMonoResolution flag -* Updated MSBuild version -* Assume FSharp.Core 4.4.0.0 - -#### 4.0.1 -* Integrate Microsoft\visualfsharp and fsharp\fsharp to master (including portable PDB) -* Remove .NET Framework 4.0 support (now needs .NET Framework 4.5) - -#### 4.0.0 -* Integrate Microsoft\visualfsharp and fsharp\fsharp to master - -#### 3.0.0.0 -* #538 - BackgroundCompiler takes a very long time on a big solution with a very connected project dependency graph -* #544 - Losing operator call when one of operands is application of a partially applied function -* #534 - Function valued property erasing calls -* #495 - Detupling missing when calling a module function value -* #543 - Tuple not being destructured in AST -* #541 - Results of multiple calls to active pattern are always bound to variable with same name -* #539 - BasicPatterns.NewDelegate shows same value for different arguments - -#### 2.0.0.6 -* #530 - Adjust ProjectCracker NuGet for VS/NuGet - -#### 2.0.0.5 -* #527 - Provide API that includes printf specifier arities along with ranges - -#### 2.0.0.4 -* #519 - Change nuget layout for ProjectCracker package -* #523 - Project cracking: spaces in file paths - -#### 2.0.0.3 -* #508 - Integrate visualfsharp/master removal of Silverlight #if -* #513 - Make CrackerTool `internal` to prevent accidental usage -* #515 - Add simple Visual Studio version detection for project cracker - -#### 2.0.0.2 -* Integrate visualfsharp/master and fsharp/master --> master -* Expose QualifiedName and FileName of FSharpImplementationFileContents -* Add FSharpErrorInfo.ErrorNumber - -#### 2.0.0.1-beta -* Fix 452 - FSharpField.IsMutable = true for BCL enum cases -* Fix 414 - Add IsInstanceMemberInCompiledCode - -#### 2.0.0.0-beta -* Feature #470, #478, #479 - Move ProjectCracker to separate nuget package and DLL, used ProjectCrackerTool.exe to run -* Feature #463 - Expose slot signatures of members in object expressions -* Feature #469, #475 - Add EvalExpressionNonThrowing, EvalInteractionNonThrowing, EvalScriptNonThrowing -* Fix #456 - FCS makes calls to kernel32.dll when running on OSX -* Fix #473 - stack overflow in resolution logic -* Fix #460 - Failure getting expression for a provided method call - -#### 1.4.2.3 - -* Fix bug in loop optimization, apply https://github.com/Microsoft/visualfsharp/pull/756/ - -#### 1.4.2.2 - -* #488 - Performance problems with project references - -#### 1.4.2.1 - -* #450 - Correct generation of ReferencedProjects - -#### 1.4.2.0 - -* Fix bug in double lookup of cache, see https://github.com/fsharp/FSharp.Compiler.Service/pull/447 - -#### 1.4.1 - -* Add pause before backgrounnd work starts. The FCS request queue must be empty for 1 second before work will start -* Write trace information about the reactor queue to the event log -* Rewrite reactor to consistently prioritize queued work -* Implement cancellation for queued work if it is cancelled prior to being executed -* Adjust caching to check cache correctly if there is a gap before the request is executed - -#### 1.4.0.9 - -* FSharpType.Format fix -* Disable maximum-memory trigger by default until use case ironed out - -#### 1.4.0.8 - -* FSharpType.Format now prettifies type variables. If necessary, FSharpType.Prettify can also be called -* Add maximum-memory trigger to downsize FCS caches. Defaults to 1.7GB of allocaed memory in the system - process for a 32-bit process, and 2x this for a 64-bit process - -#### 1.4.0.7 - -* fix 427 - Make event information available for properties which represent first-class uses of F#-declared events -* fix 410 - Symbols for C# fields (and especially enum fields) -* Expose implemented abstract slots -* Fix problem with obscure filenames caught by Microsoft\visualfsharp tests -* Integrate with visualfsharp master - -#### 1.4.0.6 - -* fix 423 - Symbols for non-standard C# events -* fix 235 - XmlDocSigs for references assemblies -* fix 177 - GetAllUsesOfAllSymbolsInFile returns nothing for C# nested enum -* make Internal.Utilities.Text.Lexing.Position a struct -* Exposing assembly attributes on FSharpAssemblySignature -* clean up IncrementalFSharpBuild.frameworkTcImportsCache - -#### 1.4.0.5 - -* add more entries to FSharpTokenTag - -#### 1.4.0.4 - -* add more entries to FSharpTokenTag -* add PrettyNaming.QuoteIdentifierIfNeeded and PrettyNaming.KeywordNames - -#### 1.4.0.3 - -* integrate Microsoft/visualfsharp OOB cleanup via fsharp/fsharp -* Make Parser and Lexer private - -#### 1.4.0.2 - -* #387 - types and arrays in F# attribute contructor arguments - -#### 1.4.0.1 - F# 4.0 support -* Use FSharp.Core 4.4.0.0 by default for scripting scenarios if not FSharp.Core referenced by host process - -#### 1.4.0.0-beta - F# 4.0 support -* Integrate F# 4.0 support into FSharp.Compiler.Service - -#### 1.3.1.0 - -* simplified source indexing with new SourceLink -* Add noframework option in AST compiler methods - -#### 0.0.90 - -* Add fix for #343 Use ResolveReferences task -* Expose BinFolderOfDefaultFSharpCompiler to editors -* Fix the registry checking on mono to avoid unnecessary exceptions being thrown - -#### 0.0.89 - -* Fix output location of referenced projects - -#### 0.0.88 - -* Added Fix to allow implicit PCL references to be retrieved - -#### 0.0.87 - -* Don't report fake symbols in indexing #325 -* Add EnclosingEntity for an active pattern group #327 -* Add ImmediateSubExpressions #284 -* integrate fsharp/fsharp master into master - -#### 0.0.85 - -* Fix for FSharpSymbolUse for single case union type #301 -* Added supprt for ReturnParameter in nested functions - -#### 0.0.84 - -* Added curried parameter groups for nested functions - -#### 0.0.83 - -* Add Overloads to the symbols signature so it is publicly visible -* Update OnEvaluation event to have FSharpSymbolUse information available - -#### 0.0.82 - -* Better support for Metadata of C# (and other) Assemblies. -* Expose the DefaultFileSystem as a type instead of anonymous - -#### 0.0.81 - -* Update GetDeclarationListSymbols to expose FSharpSymbolUse -* Improve reporting of format specifiers - -#### 0.0.80 - -* Update to latest F# 3.1.3 (inclunding updated FsLex/FsYacc used in build of FCS) -* Report printf specifiers from Service API -* Improve Accessibility of non-F# symbols - -#### 0.0.79 - -* Do not use memory mapped files when cracking a DLL to get an assembly reference -* Fix for multilanguage projects in project cracker - -#### 0.0.78 - -* Reduce background checker memory usage -* add docs on FSharp.Core -* docs on caches and queues - -#### 0.0.77 - -* Update to github.com/fsharp/fsharp 05f426cee85609f2fe51b71473b07d7928bb01c8 - -#### 0.0.76 - -* Fix #249 - Fix TryFullName when used on namespaces of provided erased type definitions -* Add OnEvaluation event to FCS to allow detailed information to be exposed - -#### 0.0.75 - -* Do not use shared cursor for IL binaries (https://github.com/fsprojects/VisualFSharpPowerTools/issues/822) - -#### 0.0.74 - -* Extension members are returned as members of current modules -* Fix exceptions while cross-reference a type provider project - -#### 0.0.73 - -* Add AssemblyContents and FSharpExpr to allow access to resolved, checked expression trees -* Populate ReferencedProjects using ProjectFileInfo -* Fix finding symbols declared in signature files -* Add logging to project cracking facility - -#### 0.0.72 - -* Allow project parser to be used on project file with relative paths -* Expose attributes for non-F# symbols - -#### 0.0.71 - -* More renamings in SourceCodeServices API for more consistent use of 'FSharp' prefix - -#### 0.0.70 - -* Make FSharpProjectFileParser public -* Fixes to project parser for Mono (.NET 4.0 component) -* Renamings in SourceCodeServices API for more consistent use of 'FSharp' prefix - -#### 0.0.67 - -* Fixes to project parser for Mono - -#### 0.0.66 - -* Fixes to project parser for Mono -* Use MSBuild v12.0 for reference resolution on .NET 4.5+ - -#### 0.0.65 - -* Fixes to project parser - -#### 0.0.64 - -* Add project parser, particularly GetProjectOptionsFromProjectFile - -#### 0.0.63 - -* #221 - Normalize return types of .NET events - -#### 0.0.62 - -* Integrate to latest https://github.com/fsharp/fsharp (#80f9221f811217bd890b3a670d717ebc510aeeaf) - -#### 0.0.61 - -* #216 - Return associated getters/setters from F# properties -* #214 - Added missing XmlDocSig for FSharpMemberOrFunctionOrValue's Events, Methods and Properties -* #213 - Retrieve information for all active pattern cases -* #188 - Fix leak in file handles when using multiple instances of FsiEvaluationSession, and add optionally collectible assemblies - -#### 0.0.60 - -* #207 - Add IsLiteral/LiteralValue to FSharpField -* #205 - Add IsOptionalArg and related properties to FSharpParameter -* #210 - Check default/override members via 'IsOverrideOrExplicitMember' -* #209 - Add TryFullName to FSharpEntity - -#### 0.0.59 - -* Fix for #184 - Fix EvalScript by using verbatim string for #Load -* Fix for #183 - The line no. reporting is still using 0-based indexes in errors. This is confusing. - -#### 0.0.58 - -* Fix for #156 - The FSharp.Core should be retrieved from the hosting environment - -#### 0.0.57 - -* Second fix for #160 - Nuget package now contains .NET 4.0 and 4.5 - -#### 0.0.56 - -* Fix for #160 - Nuget package contains .NET 4.0 and 4.5 - -#### 0.0.55 - -* Integrate changes for F# 3.1.x, Fix #166 - -#### 0.0.54 - -* Fix for #159 - Unsubscribe from TP Invalidate events when disposing builders - -#### 0.0.53 - -* Add queue length to InteractiveChecker - -#### 0.0.52 - -* Fix caches keeping hold of stale entries - -#### 0.0.51 - -* Add IsAccessible to FSharpSymbol, and ProjectContext.AccessibilityRights to give the context of an access - -#### 0.0.50 - -* Fix #79 - FindUsesOfSymbol returns None at definition of properties with explicit getters and setters - -#### 0.0.49 - -* Fix #138 - Fix symbol equality for provided type members -* Fix #150 - Return IsGetterMethod = true for declarations of F# properties (no separate 'property' symbol is yet returned, see #79) -* Fix #132 - Add IsStaticInstantiation on FSharpEntity to allow clients to detect fake symbols arising from application of static parameters -* Fix #154 - Add IsArrayType on FSharpEntity to allow clients to detect the symbols for array types -* Fix #96 - Return resolutions of 'Module' and 'Type' in "Module.field" and "Type.field" - -#### 0.0.48 - -* Allow own fsi object without referencing FSharp.Compiler.Interactive.Settings.dll (#127) - -#### 0.0.47 - -* Adjust fix for #143 for F# types with abstract+default events - -#### 0.0.46 - -* Fix multi-project analysis when referenced projects have changed (#141) -* Fix process exit on bad arguments to FsiEvaluationSession (#126) -* Deprecate FsiEvaluationSession constructor and add FsiEvaluationSession.Create static method to allow for future API that can return errors -* Return additional 'property' and 'event' methods for F#-defined types to regularize symbols (#108, #143) -* Add IsPropertySetterMethod and IsPropertyGetterMethod which only return true for getter/setter methods, not properties. Deprecate IsSetterMethod and IsGetterMethod in favour of these. -* Add IsEventAddMethod and IsEventRemoveMethod which return true for add/remove methods with an associated event -* Change IsProperty and IsEvent to only return true for the symbols for properties and events, rather than the methods associated with these -* Fix value of Assembly for some symbols (e.g. property symbols) - -#### 0.0.45 - -* Add optional project cache size parameter to InteractiveChecker -* Switch to openBinariesInMemory for SimpleSourceCodeServices -* Cleanup SimpleSourceCodeServices to avoid code duplication - -#### 0.0.44 - -* Integrate latest changes from visualfsharp.codeplex.com via github.com/fsharp/fsharp -* Fix problem with task that generates description text of declaration -* Add AllInterfaceTypes to FSharpEntity and FSharpType -* Add BaseType to FSharpType to propagate instantiation -* Add Instantiate to FSharpType - -#### 0.0.43 - -* Fix #109 - Duplicates in GetUsesOfSymbolInFile - -#### 0.0.42 - -* Fix #105 - Register enum symbols in patterns -* Fix #107 - Return correct results for inheritance chain of .NET types -* Fix #101 - Add DeclaringEntity property - -#### 0.0.41 - -* Fixed #104 - Make all operations that may utilize the FCS reactor async -* Add FSharpDisplayContext and FSharpType.Format -* Replace GetSymbolAtLocationAlternate by GetSymbolUseAtLocation - -#### 0.0.40 - -* Fixed #86 - Expose Microsoft.FSharp.Compiler.Interactive.Shell.Settings.fsi -* Fixed #99 - Add IsNamespace property to FSharpEntity - -#### 0.0.39 - -* Fixed #79 - Usage points for symbols in union patterns - -#### 0.0.38 - -* Fixed #94 and #89 by addition of new properties to the FSharpSymbolUse type -* Fixed #93 by addition of IsOpaque to FSharpEntity type -* Fixed #92 - Issue with nested classes -* Fixed #87 - Allow analysis of members from external assemblies - -#### 0.0.37 - -* Obsolete HasDefaultValue - see https://github.com/fsharp/FSharp.Compiler.Service/issues/77 - -#### 0.0.36 - -* Fix #71 - Expose static parameters and xml docs of type providers -* Fix #63 - SourceCodeServices: #r ignores include paths passed as command-line flags - -#### 0.0.35 - -* Fix #38 - FSharp.Compiler.Services should tolerate an FSharp.Core without siginfo/optdata in the search path - - -#### 0.0.34 - -* Add StaticParameters property to entities, plus FSharpStaticParameter symbol -* Fix #65 - -#### 0.0.33 - -* Add FullName and Assembly properties for symbols -* Fix #76 -* Add Japanese documentation - -#### 0.0.32 - -* Make ParseFileInProject asynchronous -* Add ParseAndCheckFileInProject -* Use cached results in ParseAndCheckFileInProject if available - -#### 0.0.31 - -* Fix performance problem with CheckFileInProject - -#### 0.0.30 - -* Add initial prototype version of multi-project support, through optional ProjectReferences in ProjectOptions. Leave this empty - to use DLL/file-based references to results from other projects. - -#### 0.0.29 - -* Fix symbols for named union fields in patterns - -#### 0.0.28 - -* Fix symbols for named union fields -* Add FSharpActivePatternCase to refine FSharpSymbol - -#### 0.0.27 - -* Fix exception tag symbol reporting - -#### 0.0.26 - -* Fix off-by-one in reporting of range for active pattern name - -#### 0.0.25 - -* Add optional source argument to TryGetRecentTypeCheckResultsForFile to specify that source must match exactly - -#### 0.0.24 - -* Update version number as nuget package may not have published properly - -#### 0.0.23 - -* Move to one-based line numbering everywhere -* Provide better symbol information for active patterns - -#### 0.0.22 - -* Provide symbol location for type parameters - -#### 0.0.21 - -* Add GetUsesOfSymbolInFile -* Better symbol resolution results for type parameter symbols - -#### 0.0.20 - -* Update version number as nuget package may not have published properly - -#### 0.0.19 - -* Change return type of GetAllUsesOfSymbol, GetAllUsesOfAllSymbols and GetAllUsesOfAllSymbolsInFile to FSharpSymbolUse -* Add symbol uses when an abstract member is implemented. - -#### 0.0.18 - -* Add GetAllUsesOfAllSymbols and GetAllUsesOfAllSymbolsInFile - -#### 0.0.17 - -* Improvements to symbol accuracy w.r.t. type abbreviations - -#### 0.0.16 - -* Make FSharpEntity.BaseType return an option -* FsiSesion got a new "EvalScript" method which allows to evaluate .fsx files - -#### 0.0.15 - -* Update version number as nuget package may not have published properly - -#### 0.0.14 - -* Update version number as nuget package may not have published properly - -#### 0.0.13-alpha - -* Fix #39 - Constructor parameters are mistaken for record fields in classes - -#### 0.0.12-alpha - -* Make the parts of the lexer/parser used by 'XmlDoc' tools in F# VS Power tools public - -#### 0.0.11-alpha - -* Add 'IsUnresolved' - -#### 0.0.10-alpha - -* Fix bug where 'multiple references to FSharp.Core' was given as error for scripts - -#### 0.0.9-alpha - -* Fix fsc corrupting assemblies when generating pdb files (really) -* Give better error messages for missing assemblies -* Report more information about symbols returned by GetSymbolAtLocation (through subtypes) -* Fix typos in docs -* Return full project results from ParseAndCheckInteraction -* Be more robust to missing assembly references by default. - -#### 0.0.8-alpha - -* Fix fsc corrupting assemblies when generating pdb files - -#### 0.0.7-alpha - -* Fix docs -* Make symbols more robust to missing assemblies -* Be robust to failures on IncrementalBuilder creation -* Allow use of MSBuild resolution by IncrementalBuilder - -#### 0.0.6-alpha - -* Fix version number - -#### 0.0.5-alpha - -* Added GetUsesOfSymbol(), FSharpSymbol type, GetSymbolAtLocation(...) - -#### 0.0.4-alpha - -* Added documentation of file system API -* Reporte errors correctly from ParseAndCheckProject - - -#### 0.0.3-alpha - -* Integrate FSharp.PowerPack.Metadata as the FSharp* symbol API -* Renamed Param --> MethodGroupItemParameter and hid record from view, made into an object -* Renamed Method --> MethodGroupItem and hid record from view, made into an object -* Renamed Methods --> MethodGroup and hid record from view, made into an object -* Renamed MethodGroup.Name --> MethodGroup.MethodName -* Renamed DataTip --> ToolTip consistently across all text -* Renamed CheckOptions --> ProjectOptions -* Renamed TypeCheckAnswer --> CheckFileAnswer -* Renamed UntypedParseInfo --> ParseFileResults -* Removed GetCheckOptionsFromScriptRoot member overload in favour of optional argument -* Renamed GetCheckOptionsFromScriptRoot --> GetProjectOptionsFromScript -* Renamed UntypedParse --> ParseFileInProject -* Renamed TypeCheckSource --> CheckFileInProjectIfReady -* Added numerous methods to API including CheckFileInProject -* Added experimental GetBackgroundCheckResultsForFileInProject, GetBackgroundParseResultsForFileInProject -* Added PartialAssemblySignature to TypeCheckResults/CheckFileResults -* Added CurrentPartialAssemblySignature to FsiEvaluationSession -* Added ParseAndCheckInteraction to FsiEvaluationSession to support intellisense implementation against a script fragment -* Added initial testing in tests/service -* Added ParseAndCheckProject to SourceCodeServices API. This will eventually return "whole project" information such as symbol tables. -* Added GetDefaultConfiguration to simplify process of configuring FsiEvaluationSession -* Added PartialAssemblySignatureUpdated event to FsiEvaluationSession -* Added travis build - -#### 0.0.2-alpha - -* Integrate hosted FSI configuration, SimpleSourceCodeServices, cleanup to SourceCodeServices API - - diff --git a/fcs/build.cmd b/fcs/build.cmd deleted file mode 100644 index dc47a88f8c..0000000000 --- a/fcs/build.cmd +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -setlocal -pushd %~dp0% - -dotnet tool restore - -if errorlevel 1 ( - endlocal - exit /b %errorlevel% -) - -dotnet paket restore -if errorlevel 1 ( - endlocal - exit /b %errorlevel% -) - -:: don't care if this fails -dotnet build-server shutdown >NUL 2>&1 - -dotnet fake build -t %* - -if errorlevel 1 ( - endlocal - exit /b %errorlevel% -) -endlocal -exit /b 0 diff --git a/fcs/build.fsx b/fcs/build.fsx deleted file mode 100644 index 4bdc506926..0000000000 --- a/fcs/build.fsx +++ /dev/null @@ -1,234 +0,0 @@ -// -------------------------------------------------------------------------------------- -// FAKE build script -// -------------------------------------------------------------------------------------- -#r "paket: groupref Main //" -#load "./.fake/build.fsx/intellisense.fsx" - -open System -open System.IO -open Paket -open Fake.BuildServer -open Fake.Core -open Fake.DotNet -open Fake.IO -open Fake.Api -open Fake.Tools - -BuildServer.install [ AppVeyor.Installer ] -// -------------------------------------------------------------------------------------- -// Utilities -// -------------------------------------------------------------------------------------- - -let withDotnetExe = - // Build.cmd normally downloads a dotnet cli to: \artifacts\toolset\dotnet - // check if there is one there to avoid downloading an additional one here - let pathToCli = Path.Combine(__SOURCE_DIRECTORY__, @"..\artifacts\toolset\dotnet\dotnet.exe") - if File.Exists(pathToCli) then - (fun opts -> { opts with DotNet.Options.DotNetCliPath = pathToCli }) - else - DotNet.install (fun cliOpts -> { cliOpts with Version = DotNet.CliVersion.GlobalJson }) - -let runDotnet workingDir command args = - let result = DotNet.exec (DotNet.Options.withWorkingDirectory workingDir >> withDotnetExe) command args - - if result.ExitCode <> 0 then failwithf "dotnet %s %s failed with code %d and errors:\n%s" command args result.ExitCode (result.Errors |> String.concat "\n") - -// -------------------------------------------------------------------------------------- -// The rest of the code is standard F# build script -// -------------------------------------------------------------------------------------- - -let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs/Release") -let packagesDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/packages/Release/Shipping") -let docsDir = Path.Combine(__SOURCE_DIRECTORY__, "docsrc", "_public") - -// Read release notes & version info from RELEASE_NOTES.md -let release = ReleaseNotes.load (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") -let isVersionTag (tag: string) = Version.TryParse tag |> fst -let assemblyVersion = release.NugetVersion - -Target.create "Clean" (fun _ -> - Shell.cleanDir releaseDir - Shell.cleanDir docsDir -) - -Target.create "Restore" (fun _ -> - // We assume a paket restore has already been run - runDotnet __SOURCE_DIRECTORY__ "restore" "../src/buildtools/buildtools.proj -v n" - runDotnet __SOURCE_DIRECTORY__ "restore" "FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj -v n" -) - -let outputs =[ - "FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj" - "../src/fsharp/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj" - "FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj" -] - -Target.create "Build" (fun _ -> - runDotnet __SOURCE_DIRECTORY__ "build" "../src/buildtools/buildtools.proj -v n -c Proto" - let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp3.1/fslex.dll" - let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp3.1/fsyacc.dll" - - let build relPath = - let dir, proj = Path.getDirectory relPath, Path.GetFileName relPath - runDotnet (Path.Combine(__SOURCE_DIRECTORY__, dir)) "build" (sprintf "%s -nodereuse:false -v n -c Release /p:DisableCompilerRedirection=true /p:FsLexPath=%s /p:FsYaccPath=%s" proj fslexPath fsyaccPath) - - outputs - |> List.iter build -) - -Target.create "Test" (fun _ -> - // This project file is used for the netcoreapp2.0 tests to work out reference sets - runDotnet __SOURCE_DIRECTORY__ "build" "../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -nodereuse:false -v n /restore /p:DisableCompilerRedirection=true" - - // Now run the tests (different output files per TFM) - let logFilePath = Path.Combine(__SOURCE_DIRECTORY__, "..", "artifacts", "TestResults", "Release", "FSharp.Compiler.Service.Test.{framework}.xml") - runDotnet (Path.Combine(__SOURCE_DIRECTORY__, "FSharp.Compiler.Service.Tests")) "test" (sprintf "FSharp.Compiler.Service.Tests.fsproj -nodereuse:false -v n -c Release --logger \"nunit;LogFilePath=%s\"" logFilePath) -) - -Target.create "NuGet" (fun _ -> - outputs - |> List.iter ( - DotNet.pack (fun packOpts -> - { packOpts with - Configuration = DotNet.BuildConfiguration.Release - Common = packOpts.Common |> withDotnetExe |> DotNet.Options.withVerbosity (Some DotNet.Verbosity.Normal) - MSBuildParams = { packOpts.MSBuildParams with - Properties = packOpts.MSBuildParams.Properties @ [ "Version", assemblyVersion; "VersionPrefix", assemblyVersion; "PackageReleaseNotes", release.Notes |> String.concat "\n" ] } - }) - ) -) - -Target.create "GenerateDocs" (fun _ -> - runDotnet "docsrc" "fornax" "build" -) - - -open Fake.IO.Globbing.Operators - -let packagesPatterns = - !! (sprintf "%s/*.%s.nupkg" releaseDir release.NugetVersion) - ++ (sprintf "%s/FSharp.DependencyManager.Nuget.%s.nupkg" packagesDir release.NugetVersion) - -Target.create "PublishNuGet" (fun _ -> - let apikey = - Environment.environVarOrNone "NUGET_APIKEY" - |> Option.defaultWith (fun _ -> UserInput.getUserPassword "Nuget API Key: ") - - packagesPatterns - |> Seq.iter (fun nupkg -> - DotNet.nugetPush (fun p -> { - p with - PushParams = { p.PushParams with - ApiKey = Some apikey - Source = Some "https://api.nuget.org/v3/index.json" } - }) nupkg - ) -) - -let anchor (path: string) = - System.IO.Path.GetFullPath(Path.Combine(__SOURCE_DIRECTORY__, path)) - -let bumpMajor (semver: Paket.SemVerInfo) = - { semver with Major = semver.Major + 1u - Minor = 0u - Patch = 0u } - -let bumpMinor (semver: Paket.SemVerInfo) = - { semver with Minor = semver.Minor + 1u - Patch = 0u } - -let bumpPatch (semver: Paket.SemVerInfo) = - { semver with Patch = semver.Patch + 1u } - -let (|WithinRange|OutsideRange|) (leftSemver, (magnitude: SynVer.Version), rightSemver) = - let allowedMin = - match magnitude with - | SynVer.Version.Major -> bumpMajor leftSemver - | SynVer.Version.Minor -> bumpMinor leftSemver - | SynVer.Version.Patch -> bumpPatch leftSemver - - if rightSemver < allowedMin || rightSemver < leftSemver then OutsideRange else WithinRange - -Target.create "ValidateVersionBump" (fun _ -> - let intendedVersion = Paket.PublicAPI.ParseSemVer release.NugetVersion - let lockfile = Paket.LockFile.LoadFrom "paket.lock" - let refGroup = lockfile.Groups.[Paket.Domain.GroupName "reference"] - let oldPackage = refGroup.Resolution.[Paket.Domain.PackageName "FSharp.Compiler.Service"] - let oldVersion = oldPackage.Version - let oldSurfaceArea = SynVer.SurfaceArea.ofAssembly (System.Reflection.Assembly.LoadFile (anchor "packages/reference/FSharp.Compiler.Service/lib/netstandard2.0/FSharp.Compiler.Service.dll")) - let newSurfaceArea = SynVer.SurfaceArea.ofAssembly (System.Reflection.Assembly.LoadFile (anchor "../artifacts/bin/fcs/Release/netstandard2.0/FSharp.Compiler.Service.dll")) - let (computedVersion, computedMagnitude) = SynVer.SurfaceArea.bump (string oldVersion) oldSurfaceArea newSurfaceArea - let parsedComputedVersion = Paket.PublicAPI.ParseSemVer computedVersion - let apiDiffs = SynVer.SurfaceArea.diff oldSurfaceArea newSurfaceArea |> String.concat "\n" - match oldVersion, computedMagnitude, intendedVersion with - | WithinRange -> - Trace.tracefn "Version %A is within the allowed range of %A from the prior version of %A" intendedVersion computedMagnitude oldVersion - | OutsideRange -> - failwithf """Version bump invalid. - Version packaged was %A - Version computed due to API diffs was %A - Allowed version magnitude change is %A - The full set of API diffs is: -%A -""" intendedVersion parsedComputedVersion computedMagnitude apiDiffs -) - -Target.create "CreateRelease" (fun _ -> - async { - let client = GitHub.createClientWithToken (Environment.environVarOrNone "GITHUB_TOKEN" |> Option.defaultWith (fun _ -> UserInput.getUserPassword "Github API Token: ")) - let currentSha = Git.Information.getCurrentSHA1 "" - let releaseParams (input: GitHub.CreateReleaseParams) = - { input with - Name = sprintf "Release %s" release.NugetVersion - Body = release.Notes |> String.concat "\n" - TargetCommitish = currentSha } - let artifacts = packagesPatterns - let! release = GitHub.createRelease "fsharp" "FSharp.Compiler.Service" assemblyVersion releaseParams client - let! _release = GitHub.uploadFiles artifacts (async.Return release) - return () - } - |> Async.RunSynchronously -) - - -// -------------------------------------------------------------------------------------- -// Run all targets by default. Invoke 'build ' to override - - - -Target.create "Start" ignore -Target.create "Release" ignore -Target.create "TestAndNuGet" ignore - -open Fake.Core.TargetOperators - -"Start" - ==> "Restore" - ==> "Clean" - ==> "Build" - -"Build" - ==> "Test" - -"Build" - ==> "NuGet" - -"Test" - ==> "TestAndNuGet" - -"NuGet" - ==> "TestAndNuGet" - -"Build" - ==> "NuGet" - ==> "ValidateVersionBump" - ==> "PublishNuGet" - ==> "Release" - -"Build" - ==> "GenerateDocs" - -"GenerateDocs" - ==> "Release" - -Target.runOrDefaultWithArguments "Build" diff --git a/fcs/build.sh b/fcs/build.sh deleted file mode 100755 index 4c4819aca7..0000000000 --- a/fcs/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# bail out as soon as any single command errors -set -e - -start_pwd=$PWD - -# dotnet tools look in certain paths by default that Just Work when we're in the fcs dir, -# so let's force that here: -cd $(dirname ${BASH_SOURCE[0]}) - -dotnet tool restore -dotnet paket restore -dotnet fake build -t $@ - -# but we'll be nice and go back to the start dir at the end -cd $start_pwd \ No newline at end of file diff --git a/fcs/dependencies/MSBuild.v12.0/.gitignore b/fcs/dependencies/MSBuild.v12.0/.gitignore deleted file mode 100644 index 6a7461313b..0000000000 --- a/fcs/dependencies/MSBuild.v12.0/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.dll diff --git a/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.csproj b/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.csproj deleted file mode 100644 index b59e15cd05..0000000000 --- a/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - net45 - MSBuild.v12.0.nuspec - - - - - diff --git a/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.nuspec b/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.nuspec deleted file mode 100644 index e3047f0a96..0000000000 --- a/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - FSharp.Compiler.Service.MSBuild.v12.0 - 1.0 - Microsoft and F# Software Foundation - MSBuild.v12.0 dependencies for fcs. - - - - - - - - - - - - - diff --git a/fcs/dependencies/MSBuild.v12.0/README.md b/fcs/dependencies/MSBuild.v12.0/README.md deleted file mode 100644 index 6fe2cf4f3b..0000000000 --- a/fcs/dependencies/MSBuild.v12.0/README.md +++ /dev/null @@ -1,9 +0,0 @@ -The MSBuild.12.0 dependencies have been converted to a NuGet package. - -To create an updated version of the package: - -1. Copy the appropriate `Microsoft.Build.*.dll` files to this directory. -2. Update the `` element of `MSBuild.v12.0.nuspec`. -3. Run `msbuild MSBuild.v12.0.csproj /t:Pack` -4. Upload `\artifacts\bin\fcs\FSharp.Compiler.Service.MSBuild.v12.0.*.nupkg` to the MyGet feed at - `https://dotnet.myget.org/F/fsharp/api/v3/index.json` diff --git a/fcs/docsrc/_lib/Fornax.Core.dll b/fcs/docsrc/_lib/Fornax.Core.dll deleted file mode 100644 index b8754840a0..0000000000 Binary files a/fcs/docsrc/_lib/Fornax.Core.dll and /dev/null differ diff --git a/fcs/docsrc/config.fsx b/fcs/docsrc/config.fsx deleted file mode 100644 index 369a4c6e49..0000000000 --- a/fcs/docsrc/config.fsx +++ /dev/null @@ -1,19 +0,0 @@ -#r "_lib/Fornax.Core.dll" - -open Config - -let customRename (page: string) = - System.IO.Path.ChangeExtension(page.Replace ("content/", ""), ".html") - -let isScriptToParse (ap, rp : string) = - let folder = System.IO.Path.GetDirectoryName rp - folder.Contains "content" && rp.EndsWith ".fsx" - -let config = { - Generators = [ - {Script = "page.fsx"; Trigger = OnFileExt ".md"; OutputFile = Custom customRename } - {Script = "page.fsx"; Trigger = OnFilePredicate isScriptToParse; OutputFile = Custom customRename } - {Script = "apiref.fsx"; Trigger = Once; OutputFile = MultipleFiles (sprintf "reference/%s.html") } - {Script = "lunr.fsx"; Trigger = Once; OutputFile = NewFileName "index.json" } - ] -} diff --git a/fcs/docsrc/content/caches.fsx b/fcs/docsrc/content/caches.fsx deleted file mode 100644 index 48b2d0c187..0000000000 --- a/fcs/docsrc/content/caches.fsx +++ /dev/null @@ -1,89 +0,0 @@ -(** ---- -category: how-to -title: Notes on the FSharpChecker caches -menu_order: 2 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Notes on the FSharpChecker caches -================================================= - -This is a design note on the FSharpChecker component and its caches. See also the notes on the [FSharpChecker operations queue](queue.html) - -Each FSharpChecker object maintains a set of caches. These are - -* ``scriptClosureCache`` - an MRU cache of default size ``projectCacheSize`` that caches the - computation of GetProjectOptionsFromScript. This computation can be lengthy as it can involve processing the transitive closure - of all ``#load`` directives, which in turn can mean parsing an unbounded number of script files - -* ``incrementalBuildersCache`` - an MRU cache of projects where a handle is being kept to their incremental checking state, - of default size ``projectCacheSize`` (= 3 unless explicitly set as a parameter). - The "current background project" (see the [FSharpChecker operations queue](queue.html)) - will be one of these projects. When analyzing large collections of projects, this cache usually occupies by far the most memory. - Increasing the size of this cache can dramatically decrease incremental computation of project-wide checking, or of checking - individual files within a project, but can very greatly increase memory usage. - -* ``braceMatchCache`` - an MRU cache of size ``braceMatchCacheSize`` (default = 5) keeping the results of calls to MatchBraces, keyed by filename, source and project options. - -* ``parseFileCache`` - an MRU cache of size ``parseFileCacheSize`` (default = 2) keeping the results of ParseFile, - keyed by filename, source and project options. - -* ``checkFileInProjectCache`` - an MRU cache of size ``incrementalTypeCheckCacheSize`` (default = 5) keeping the results of - ParseAndCheckFileInProject, CheckFileInProject and/or CheckFileInProjectIfReady. This is keyed by filename, file source - and project options. The results held in this cache are only returned if they would reflect an accurate parse and check of the - file. - -* ``getToolTipTextCache`` - an aged lookup cache of strong size ``getToolTipTextSize`` (default = 5) computing the results of GetToolTipText. - -* ``ilModuleReaderCache`` - an aged lookup of weak references to "readers" for references .NET binaries. Because these - are all weak references, you can generally ignore this cache, since its entries will be automatically collected. - Strong references to binary readers will be kept by other FCS data structures, e.g. any project checkers, symbols or project checking results. - - In more detail, the bytes for referenced .NET binaries are read into memory all at once, eagerly. Files are not left - open or memory-mapped when using FSharpChecker (as opposed to FsiEvaluationSession, which loads assemblies using reflection). - The purpose of this cache is mainly to ensure that while setting up compilation, the reads of mscorlib, FSharp.Core and so on - amortize cracking the DLLs. - -* ``frameworkTcImportsCache`` - an aged lookup of strong size 8 which caches the process of setting up type checking against a set of system - components (e.g. a particular version of mscorlib, FSharp.Core and other system DLLs). These resources are automatically shared between multiple - project checkers which happen to reference the same set of system assemblies. - -Profiling the memory used by the various caches can be done by looking for the corresponding static roots in memory profiling traces. - -The sizes of some of these caches can be adjusted by giving parameters to FSharpChecker. Unless otherwise noted, -the cache sizes above indicate the "strong" size of the cache, where memory is held regardless of the memory -pressure on the system. Some of the caches can also hold "weak" references which can be collected at will by the GC. - -> Note: Because of these caches, you should generally use one global, shared FSharpChecker for everything in an IDE application. - - -Low-Memory Condition -------- - -Version 1.4.0.8 added a "maximum memory" limit specified by the `MaxMemory` property on FSharpChecker (in MB). If an FCS project operation -is performed (see `CheckMaxMemoryReached` in `service.fs`) and `System.GC.GetTotalMemory(false)` reports a figure greater than this, then -the strong sizes of all FCS caches are reduced to either 0 or 1. This happens for the remainder of the lifetime of the FSharpChecker object. -In practice this will still make tools like the Visual Studio F# Power Tools usable, but some operations like renaming across multiple -projects may take substantially longer. - -By default the maximum memory trigger is disabled, see `maxMBDefault` in `service.fs`. - -Reducing the FCS strong cache sizes does not guarantee there will be enough memory to continue operations - even holding one project -strongly may exceed a process memory budget. It just means FCS may hold less memory strongly. - -If you do not want the maximum memory limit to apply then set MaxMemory to System.Int32.MaxValue. - -Summary -------- - -In this design note, you learned that the FSharpChecker component keeps a set of caches in order to support common -incremental analysis scenarios reasonably efficiently. They correspond roughly to the original caches and sizes -used by the Visual F# Tools, from which the FSharpChecker component derives. - -In long running, highly interactive, multi-project scenarios you should carefully -consider the cache sizes you are using and the tradeoffs involved between incremental multi-project checking and memory usage. -*) diff --git a/fcs/docsrc/content/compiler.fsx b/fcs/docsrc/content/compiler.fsx deleted file mode 100644 index 1d0b1527a9..0000000000 --- a/fcs/docsrc/content/compiler.fsx +++ /dev/null @@ -1,108 +0,0 @@ -(** ---- -category: tutorial -title: Hosted Compiler -menu_order: 8 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Hosted Compiler -=============== - -This tutorial demonstrates how to host the F# compiler. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published -*) - -(** -> **NOTE:** There are several options for hosting the F# compiler. The easiest one is to use the -`fsc.exe` process and pass arguments. -*) - -(** - -> **NOTE:** By default [compilations using FSharp.Compiler.Service reference FSharp.Core 4.3.0.0](https://github.com/fsharp/FSharp.Compiler.Service/issues/156) (matching F# 3.0). You can override -this choice by passing a reference to FSharp.Core for 4.3.1.0 or later explicitly in your command-line arguments. - -*) - -(** ---------------------------- - -First, we need to reference the libraries that contain F# interactive service: -*) - -#r "FSharp.Compiler.Service.dll" -open System.IO -open FSharp.Compiler.SourceCodeServices - -// Create an interactive checker instance -let checker = FSharpChecker.Create() - -(** -Now write content to a temporary file: - -*) -let fn = Path.GetTempFileName() -let fn2 = Path.ChangeExtension(fn, ".fsx") -let fn3 = Path.ChangeExtension(fn, ".dll") - -File.WriteAllText(fn2, """ -module M - -type C() = - member x.P = 1 - -let x = 3 + 4 -""") - -(** -Now invoke the compiler: -*) - -let errors1, exitCode1 = - checker.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |]) - |> Async.RunSynchronously - -(** - -If errors occur you can see this in the 'exitCode' and the returned array of errors: - -*) -File.WriteAllText(fn2, """ -module M - -let x = 1.0 + "" // a type error -""") - -let errors1b, exitCode1b = - checker.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |]) - |> Async.RunSynchronously - -(** - -Compiling to a dynamic assembly -=============================== - -You can also compile to a dynamic assembly, which uses the F# Interactive code generator. -This can be useful if you are, for example, in a situation where writing to the file system -is not really an option. - -You still have to pass the "-o" option to name the output file, but the output file is not actually written to disk. - -The 'None' option indicates that the initialization code for the assembly is not executed. -*) -let errors2, exitCode2, dynAssembly2 = - checker.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], execute=None) - |> Async.RunSynchronously - -(* -Passing 'Some' for the 'execute' parameter executes the initialization code for the assembly. -*) -let errors3, exitCode3, dynAssembly3 = - checker.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], Some(stdout,stderr)) - |> Async.RunSynchronously - diff --git a/fcs/docsrc/content/corelib.fsx b/fcs/docsrc/content/corelib.fsx deleted file mode 100644 index 3e7dc66c6e..0000000000 --- a/fcs/docsrc/content/corelib.fsx +++ /dev/null @@ -1,104 +0,0 @@ -(** ---- -category: how-to -title: Notes on FSharp.Core.dll -menu_order: 3 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Notes on FSharp.Core.dll -================================================= - -Shipping an FSharp.Core with your application ---------------------------------------------- - -When building applications or plug-in components which use FSharp.Compiler.Service.dll, you will normally also -include a copy of FSharp.Core.dll as part of your application. - -For example, if you build a ``HostedCompiler.exe``, you will normally place an FSharp.Core.dll (say 4.3.1.0) alongside -your ``HostedCompiler.exe``. - -Binding redirects for your application --------------------------------------- - -The FSharp.Compiler.Service.dll component depends on FSharp.Core 4.4.0.0. Normally your application will target -a later version of FSharp.Core, and you may need a [binding redirect](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions) to ensure -that other versions of FSharp.Core forward to the final version of FSharp.Core.dll your application uses. -Binding redirect files are normally generated automatically by build tools. If not, you can use one like this -(if your tool is called ``HostedCompiler.exe``, the binding redirect file is called ``HostedCompiler.exe.config``) - -Some other dependencies may also need to be reconciled and forwarded. - - - - - - - - - - - - - - - - - -Which FSharp.Core and .NET Framework gets referenced in compilation? --------------------------------------- - -The FSharp.Compiler.Service component can be used to do more or less any sort of F# compilation. -In particular you can reference an explicit FSharp.Core and/or framework -assemblies in the command line arguments (different to the FSharp.Core and a .NET Framework being used to run your tool). - -To target a specific FSharp.Core and/or .NET Framework assemblies, use the ``--noframework`` argument -and the appropriate command-line arguments: - - [] - let fsharpCorePath = - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" - let errors2, exitCode2 = - scs.Compile( - [| "fsc.exe"; "--noframework"; - "-r"; fsharpCorePath; - "-r"; @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"; - "-o"; fn3; - "-a"; fn2 |]) - -You will need to determine the location of these assemblies. The easiest way to locate these DLLs in a cross-platform way and -convert them to command-line arguments is to [crack an F# project file](https://fsharp.github.io/FSharp.Compiler.Service/project.html). -Alternatively you can compute SDK paths yourself, and some helpers to do this are in [the tests for FSharp.Compiler.Service.dll](https://github.com/fsharp/FSharp.Compiler.Service/blob/8a943dd3b545648690cb3bed652a469bdb6dd869/tests/service/Common.fs#L54). - - -What about if I am processing a script or using ``GetCheckOptionsFromScriptRoot`` -------------------------------------------------------------------------- - -If you do _not_ explicitly reference an FSharp.Core.dll from an SDK location, or if you are processing a script -using ``FsiEvaluationSession`` or ``GetCheckOptionsFromScriptRoot``, then an implicit reference to FSharp.Core will be made -by the following choice: - -1. The version of FSharp.Core.dll statically referenced by the host assembly returned by ``System.Reflection.Assembly.GetEntryAssembly()``. - -2. If there is no static reference to FSharp.Core in the host assembly, then - - - For FSharp.Compiler.Service 1.4.0.x above (F# 4.0 series), a reference to FSharp.Core version 4.4.0.0 is added - -Do I need to include FSharp.Core.optdata and FSharp.Core.sigdata? --------------------------------------- - -No, unless you are doing something with very old FSharp.Core.dll. - -Summary -------- - -In this design note we have discussed three things: - -- which FSharp.Core.dll is used to run your compilation tools -- how to configure binding redirects for the FSharp.Core.dll used to run your compilation tools -- which FSharp.Core.dll and/or framework assemblies are referenced during the checking and compilations performed by your tools. - -*) diff --git a/fcs/docsrc/content/devnotes.md b/fcs/docsrc/content/devnotes.md deleted file mode 100644 index 7cbd0b6d65..0000000000 --- a/fcs/docsrc/content/devnotes.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Developer Notes -category: explanation -menu_order: 2 ---- - -Developer notes -=============== - -Modified clone of F# compiler exposing additional functionality for editing clients and embedding F# compiler -and F# interactive as services. - -## Components - -There is one main component, `FSharp.Compiler.Service.dll`. -The main aim is to have a stable and documented fork of the main compiler that allows various -tools to share this common code. -This component allows embedding F# Interactive as a service and contains a number of -modifications to the source code of `fsi.exe` that adds `EvalExpression` and `EvalInteraction` functions. - -This repo should be _identical_ to 'fsharp' except: - - - Changes for building `FSharp.Compiler.Service.dll`, notably - - Change the assembly name - - Only build `FSharp.Compiler.Service.dll` - - No bootstrap or proto compiler is used - an installed F# compiler is assumed - - - Build script using FAKE that builds everything, produces NuGet package and - generates documentation, files for publishing NuGet packages etc. - (following [F# project scaffold](https://github.com/fsprojects/FSharp.ProjectScaffold)) - - - Changes to compiler source code to expose new functionality; Changes to the - F# Interactive service to implement the evaluation functions. - - - Additions to compiler source code which improve the API for the use of F# editing clients - - - Additions to compiler source code which add new functionality to the compiler service API - -If language or compiler additions are committed to `fsharp/fsharp`, they should be merged into -this repo and a new NuGet package released. - -## Building and NuGet - -The build process follows the standard recommended by [F# project scaffold](https://github.com/fsprojects/FSharp.ProjectScaffold) -If you want to build the project yourself then you can follow these instructions: - - [lang=text] - git clone https://github.com/fsharp/FSharp.Compiler.Service - cd FSharp.Compiler.Service - -Now follow build everything by running `build.cmd` (Windows) or `build.sh` (Linux + Mac OS). -The output will be located in the `bin` directory. If you also wish to build the documentation -and NuGet package, run `build Release` (this also attempts to publish the documentation to -GitHub, which only works if you have access to the GitHub repository). - -## Release checklist - -Release checklist to publish a new version on nuget.org - -1. Update `RELEASE_NOTES.md` -2. Check the version numbers are correct across the source (some files duplicate them) -3. Commit and add the necessary tag to the repo -4. Publish the nupkgs for `FSharp.Compiler.Service` once it appears in AppVeyor artifacts diff --git a/fcs/docsrc/content/editor.fsx b/fcs/docsrc/content/editor.fsx deleted file mode 100644 index 9c0f3fca26..0000000000 --- a/fcs/docsrc/content/editor.fsx +++ /dev/null @@ -1,262 +0,0 @@ -(** ---- -category: tutorial -title: Editor services -menu_order: 3 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Editor services -================================== - -This tutorial demonstrates how to use the editor services provided by the F# compiler. -This API is used to provide auto-complete, tool-tips, parameter info help, matching of -brackets and other functions in F# editors including Visual Studio, Xamarin Studio and Emacs -(see [fsharpbindings](https://github.com/fsharp/fsharpbinding) project for more information). -Similarly to [the tutorial on using untyped AST](untypedtree.html), we start by -getting the `InteractiveChecker` object. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published - - -Type checking sample source code --------------------------------- - -As in the [previous tutorial (using untyped AST)](untypedtree.html), we start by referencing -`FSharp.Compiler.Service.dll`, opening the relevant namespace and creating an instance -of `InteractiveChecker`: - -*) -// Reference F# compiler API -#r "FSharp.Compiler.Service.dll" - -open System -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Text - -// Create an interactive checker instance -let checker = FSharpChecker.Create() - -(** - -As [previously](untypedtree.html), we use `GetProjectOptionsFromScriptRoot` to get a context -where the specified input is the only file passed to the compiler (and it is treated as a -script file or stand-alone F# source code). - -*) -// Sample input as a multi-line string -let input = - """ - open System - - let foo() = - let msg = String.Concat("Hello"," ","world") - if true then - printfn "%s" msg. - """ -// Split the input & define file name -let inputLines = input.Split('\n') -let file = "/home/user/Test.fsx" - -let projOptions, errors = - checker.GetProjectOptionsFromScript(file, SourceText.ofString input) - |> Async.RunSynchronously - -let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions) - -(** -To perform type checking, we first need to parse the input using -`ParseFile`, which gives us access to the [untyped AST](untypedtree.html). However, -then we need to call `CheckFileInProject` to perform the full type checking. This function -also requires the result of `ParseFileInProject`, so the two functions are often called -together. -*) -// Perform parsing - -let parseFileResults = - checker.ParseFile(file, SourceText.ofString input, parsingOptions) - |> Async.RunSynchronously -(** -Before we look at the interesting operations provided by `TypeCheckResults`, we -need to run the type checker on a sample input. On F# code with errors, you would get some type checking -result (but it may contain incorrectly "guessed" results). -*) - -// Perform type checking -let checkFileAnswer = - checker.CheckFileInProject(parseFileResults, file, 0, SourceText.ofString input, projOptions) - |> Async.RunSynchronously - -(** -Alternatively you can use `ParseAndCheckFileInProject` to check both in one step: -*) - -let parseResults2, checkFileAnswer2 = - checker.ParseAndCheckFileInProject(file, 0, SourceText.ofString input, projOptions) - |> Async.RunSynchronously - -(** - -The function returns both the untyped parse result (which we do not use in this -tutorial), but also a `CheckFileAnswer` value, which gives us access to all -the interesting functionality... -*) - -let checkFileResults = - match checkFileAnswer with - | FSharpCheckFileAnswer.Succeeded(res) -> res - | res -> failwithf "Parsing did not finish... (%A)" res - -(** - -Here, we type check a simple function that (conditionally) prints "Hello world". -On the last line, we leave an additional dot in `msg.` so that we can get the -completion list on the `msg` value (we expect to see various methods on the string -type there). - - -Using type checking results ---------------------------- - -Let's now look at some of the API that is exposed by the `TypeCheckResults` type. In general, -this is the type that lets you implement most of the interesting F# source code editor services. - -### Getting a tool tip - -To get a tool tip, you can use `GetToolTipTextAlternate` method. The method takes a line number and character -offset. Both of the numbers are zero-based. In the sample code, we want to get tooltip for the `foo` -function that is defined on line 3 (line 0 is blank) and the letter `f` starts at index 7 (the tooltip -would work anywhere inside the identifier). - -In addition, the method takes a tag of token which is typically `IDENT`, when getting tooltip for an -identifier (the other option lets you get tooltip with full assembly location when using `#r "..."`). - -*) -// Get tag of the IDENT token to be used as the last argument -open FSharp.Compiler -let identToken = FSharpTokenTag.Identifier - -// Get tool tip at the specified location -let tip = checkFileResults.GetToolTipText(4, 7, inputLines.[1], ["foo"], identToken) -printfn "%A" tip - -(** - -> **NOTE:** `GetToolTipTextAlternate` is an alternative name for the old `GetToolTipText`. The old `GetToolTipText` was -deprecated because it accepted zero-based line numbers. At some point it will be removed, and `GetToolTipTextAlternate` will be renamed back to `GetToolTipText`. -*) - -(** -Aside from the location and token kind, the function also requires the current contents of the line -(useful when the source code changes) and a `Names` value, which is a list of strings representing -the current long name. For example to get tooltip for the `Random` identifier in a long name -`System.Random`, you would use location somewhere in the string `Random` and you would pass -`["System"; "Random"]` as the `Names` value. - -The returned value is of type `ToolTipText` which contains a discriminated union `ToolTipElement`. -The union represents different kinds of tool tips that you can get from the compiler. - -### Getting auto-complete lists - -The next method exposed by `TypeCheckResults` lets us perform auto-complete on a given location. -This can be called on any identifier or in any scope (in which case you get a list of names visible -in the scope) or immediately after `.` to get a list of members of some object. Here, we get a -list of members of the string value `msg`. - -To do this, we call `GetDeclarationListInfo` with the location of the `.` symbol on the last line -(ending with `printfn "%s" msg.`). The offsets are one-based, so the location is `7, 23`. -We also need to specify a function that says that the text has not changed and the current identifier -where we need to perform the completion. -*) -// Get declarations (autocomplete) for a location -let decls = - checkFileResults.GetDeclarationListInfo - (Some parseFileResults, 7, inputLines.[6], PartialLongName.Empty 23, (fun () -> []), fun _ -> false) - |> Async.RunSynchronously - -// Print the names of available items -for item in decls.Items do - printfn " - %s" item.Name - -(** - -> **NOTE:** `v` is an alternative name for the old `GetDeclarations`. The old `GetDeclarations` was -deprecated because it accepted zero-based line numbers. At some point it will be removed, and `GetDeclarationListInfo` will be renamed back to `GetDeclarations`. -*) - -(** -When you run the code, you should get a list containing the usual string methods such as -`Substring`, `ToUpper`, `ToLower` etc. The fourth argument of `GetDeclarations`, here `([], "msg")`, -specifies the context for the auto-completion. Here, we want a completion on a complete name -`msg`, but you could for example use `(["System"; "Collections"], "Generic")` to get a completion list -for a fully qualified namespace. - -### Getting parameter information - -The next common feature of editors is to provide information about overloads of a method. In our -sample code, we use `String.Concat` which has a number of overloads. We can get the list using -`GetMethods` operation. As previously, this takes zero-indexed offset of the location that we are -interested in (here, right at the end of the `String.Concat` identifier) and we also need to provide -the identifier again (so that the compiler can provide up-to-date information when the source code -changes): - -*) -// Get overloads of the String.Concat method -let methods = - checkFileResults.GetMethods(5, 27, inputLines.[4], Some ["String"; "Concat"]) - |> Async.RunSynchronously - -// Print concatenated parameter lists -for mi in methods.Methods do - [ for p in mi.Parameters -> p.Display ] - |> String.concat ", " - |> printfn "%s(%s)" methods.MethodName -(** -The code uses the `Display` property to get the annotation for each parameter. This returns information -such as `arg0: obj` or `params args: obj[]` or `str0: string, str1: string`. We concatenate the parameters -and print a type annotation with the method name. -*) - -(** - -## Asynchronous and immediate operations - -You may have noticed that `CheckFileInProject` is an asynchronous operation. -This indicates that type checking of F# code can take some time. -The F# compiler performs the work in background (automatically) and when -we call `CheckFileInProject` method, it returns an asynchronous operation. - -There is also the `CheckFileInProjectIfReady` method. This returns immediately if the -type checking operation can't be started immediately, e.g. if other files in the project -are not yet type-checked. In this case, a background worker might choose to do other -work in the meantime, or give up on type checking the file until the `FileTypeCheckStateIsDirty` event -is raised. - -> The [fsharpbinding](https://github.com/fsharp/fsharpbinding) project has more advanced -example of handling the background work where all requests are sent through an F# agent. -This may be a more appropriate for implementing editor support. - -*) - - -(** -Summary -------- - -The `CheckFileAnswer` object contains other useful methods that were not covered in this tutorial. You -can use it to get location of a declaration for a given identifier, additional colorization information -(the F# 3.1 colorizes computation builder identifiers & query operators) and others. - -Using the FSharpChecker component in multi-project, incremental and interactive editing situations may involve -knowledge of the [FSharpChecker operations queue](queue.html) and the [FSharpChecker caches](caches.html). - - -Finally, if you are implementing an editor support for an editor that cannot directly call .NET API, -you can call many of the methods discussed here via a command line interface that is available in the -[FSharp.AutoComplete](https://github.com/fsharp/fsharpbinding/tree/master/FSharp.AutoComplete) project. - - -*) diff --git a/fcs/docsrc/content/filesystem.fsx b/fcs/docsrc/content/filesystem.fsx deleted file mode 100644 index f8842e4f2f..0000000000 --- a/fcs/docsrc/content/filesystem.fsx +++ /dev/null @@ -1,198 +0,0 @@ -(** ---- -category: tutorial -title: Virtualized File System -menu_order: 9 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Virtualized File System -========================================== - -The `FSharp.Compiler.Service` component has a global variable -representing the file system. By setting this variable you can host the compiler in situations where a file system -is not available. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published. - - -Setting the FileSystem ----------------------- - -In the example below, we set the file system to an implementation which reads from disk -*) -#r "FSharp.Compiler.Service.dll" -open System -open System.IO -open System.Collections.Generic -open System.Text -open FSharp.Compiler.AbstractIL.Internal.Library - -let defaultFileSystem = Shim.FileSystem - -let fileName1 = @"c:\mycode\test1.fs" // note, the path doesn't exist -let fileName2 = @"c:\mycode\test2.fs" // note, the path doesn't exist - -type MyFileSystem() = - let file1 = """ -module File1 - -let A = 1""" - let file2 = """ -module File2 -let B = File1.A + File1.A""" - let files = dict [(fileName1, file1); (fileName2, file2)] - - interface IFileSystem with - // Implement the service to open files for reading and writing - member __.FileStreamReadShim(fileName) = - match files.TryGetValue fileName with - | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream - | _ -> defaultFileSystem.FileStreamReadShim(fileName) - - member __.FileStreamCreateShim(fileName) = - defaultFileSystem.FileStreamCreateShim(fileName) - - member __.FileStreamWriteExistingShim(fileName) = - defaultFileSystem.FileStreamWriteExistingShim(fileName) - - member __.ReadAllBytesShim(fileName) = - match files.TryGetValue fileName with - | true, text -> Encoding.UTF8.GetBytes(text) - | _ -> defaultFileSystem.ReadAllBytesShim(fileName) - - // Implement the service related to temporary paths and file time stamps - member __.GetTempPathShim() = - defaultFileSystem.GetTempPathShim() - - member __.GetLastWriteTimeShim(fileName) = - defaultFileSystem.GetLastWriteTimeShim(fileName) - - member __.GetFullPathShim(fileName) = - defaultFileSystem.GetFullPathShim(fileName) - - member __.IsInvalidPathShim(fileName) = - defaultFileSystem.IsInvalidPathShim(fileName) - - member __.IsPathRootedShim(fileName) = - defaultFileSystem.IsPathRootedShim(fileName) - - member __.IsStableFileHeuristic(fileName) = - defaultFileSystem.IsStableFileHeuristic(fileName) - - // Implement the service related to file existence and deletion - member __.SafeExists(fileName) = - files.ContainsKey(fileName) || defaultFileSystem.SafeExists(fileName) - - member __.FileDelete(fileName) = - defaultFileSystem.FileDelete(fileName) - - // Implement the service related to assembly loading, used to load type providers - // and for F# interactive. - member __.AssemblyLoadFrom(fileName) = - defaultFileSystem.AssemblyLoadFrom fileName - - member __.AssemblyLoad(assemblyName) = - defaultFileSystem.AssemblyLoad assemblyName - -let myFileSystem = MyFileSystem() -Shim.FileSystem <- MyFileSystem() - -(** - -Doing a compilation with the FileSystem ---------------------------------------- - -*) -open FSharp.Compiler.SourceCodeServices - -let checker = FSharpChecker.Create() - -let projectOptions = - let sysLib nm = - if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows - System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + - @"\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\" + nm + ".dll" - else - let sysDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() - let (++) a b = System.IO.Path.Combine(a,b) - sysDir ++ nm + ".dll" - - let fsCore4300() = - if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows - System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + - @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll" - else - sysLib "FSharp.Core" - - let allFlags = - [| yield "--simpleresolution"; - yield "--noframework"; - yield "--debug:full"; - yield "--define:DEBUG"; - yield "--optimize-"; - yield "--doc:test.xml"; - yield "--warn:3"; - yield "--fullpaths"; - yield "--flaterrors"; - yield "--target:library"; - let references = - [ sysLib "mscorlib" - sysLib "System" - sysLib "System.Core" - fsCore4300() ] - for r in references do - yield "-r:" + r |] - - { ProjectFileName = @"c:\mycode\compilation.fsproj" // Make a name that is unique in this directory. - ProjectId = None - SourceFiles = [| fileName1; fileName2 |] - OriginalLoadReferences = [] - ExtraProjectInfo=None - Stamp = None - OtherOptions = allFlags - ReferencedProjects = [| |] - IsIncompleteTypeCheckEnvironment = false - UseScriptResolutionRules = true - LoadTime = System.DateTime.Now // Note using 'Now' forces reloading - UnresolvedReferences = None } - -let results = checker.ParseAndCheckProject(projectOptions) |> Async.RunSynchronously - -results.Errors -results.AssemblySignature.Entities.Count //2 -results.AssemblySignature.Entities.[0].MembersFunctionsAndValues.Count //1 -results.AssemblySignature.Entities.[0].MembersFunctionsAndValues.[0].DisplayName // "B" - -(** -Summary -------- -In this tutorial, we've seen how to globally customize the view of the file system used by the FSharp.Compiler.Service -component. - -At the time of writing, the following System.IO operations are not considered part of the virtualized file system API. -Future iterations on the compiler service implementation may add these to the API. - - - Path.Combine - - Path.DirectorySeparatorChar - - Path.GetDirectoryName - - Path.GetFileName - - Path.GetFileNameWithoutExtension - - Path.HasExtension - - Path.GetRandomFileName (used only in generation compiled win32 resources in assemblies) - -**NOTE:** Several operations in the `SourceCodeServices` API accept the contents of a file to parse -or check as a parameter, in addition to a file name. In these cases, the file name is only used for -error reporting. - -**NOTE:** Type provider components do not use the virtualized file system. - -**NOTE:** The compiler service may use MSBuild for assembly resolutions unless `--simpleresolution` is -provided. When using the `FileSystem` API you will normally want to specify `--simpleresolution` as one -of your compiler flags. Also specify `--noframework`. You will need to supply explicit resolutions of all -referenced .NET assemblies. - -*) \ No newline at end of file diff --git a/fcs/docsrc/content/index.md b/fcs/docsrc/content/index.md deleted file mode 100644 index 7b7f417be5..0000000000 --- a/fcs/docsrc/content/index.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: F# Compiler Services -category: explanation -menu_order: 1 ---- - -F# Compiler Services -==================== - -The F# compiler services package is a component derived from the F# compiler source code that -exposes additional functionality for implementing F# language bindings, additional -tools based on the compiler or refactoring tools. The package also includes F# -interactive service that can be used for embedding F# scripting into your applications. - -
-
-
-
- The F# Compiler Services package can be installed from NuGet: -
PM> Install-Package FSharp.Compiler.Service
-
-
-
-
- -Available services ------------------- - -The project currently exposes the following services that are tested & documented on this page. -The libraries contain additional public API that can be used, but is not documented here. - -* [**F# Language tokenizer**](tokenizer.html) - turns any F# source code into a stream of tokens. - Useful for implementing source code colorization and basic tools. Correctly handle nested - comments, strings etc. - -* [**Processing untyped AST**](untypedtree.html) - allows accessing the untyped abstract syntax tree (AST). - This represents parsed F# syntax without type information and can be used to implement code formatting - and various simple processing tasks. - -* [**Using editor (IDE) services**](editor.html) - expose functionality for auto-completion, tool-tips, - parameter information etc. These functions are useful for implementing F# support for editors - and for getting some type information for F# code. - -* [**Working with signatures, types, and resolved symbols**](symbols.html) - many services related to type checking - return resolved symbols, representing inferred types, and the signatures of whole assemblies. - -* [**Working with resolved expressions**](typedtree.html) - services related to working with - type-checked expressions and declarations, where names have been resolved to symbols. - -* [**Working with projects and project-wide analysis**](project.html) - you can request a check of - an entire project, and ask for the results of whole-project analyses such as find-all-references. - -* [**Hosting F# interactive**](interactive.html) - allows calling F# interactive as a .NET library - from your .NET code. You can use this API to embed F# as a scripting language in your projects. - -* [**Hosting the F# compiler**](compiler.html) - allows you to embed calls to the F# compiler. - -* [**File system API**](filesystem.html) - the `FSharp.Compiler.Service` component has a global variable - representing the file system. By setting this variable you can host the compiler in situations where a file system - is not available. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published - -Projects using the F# Compiler Services ------------------- - -Some of the projects using the F# Compiler Services are: - -* [**The Visual F# Power Tools**](https://fsprojects.github.io/VisualFSharpPowerTools/) -* [**The Xamarin and MonoDevelop Tools for F#**](https://github.com/mono/monodevelop/tree/master/main/external/fsharpbinding) -* [**The Emacs Plugin for F#**](https://github.com/fsharp/emacs-fsharp-mode) -* [**The Vim Plugin for F#**](https://github.com/fsharp/vim-fsharp) -* [**F# language support for JetBrains Rider**](https://github.com/JetBrains/fsharp-support/) -* [**iFSharp**](https://github.com/BayardRock/IfSharp) - iPython-style notebook engine for F# -* [**CloudSharper**](https://cloudsharper.com/) - Online web and mobile programming with big data and charting -* [**Tsunami**](http://tsunami.io) - Tsunami enhances applications and workflows with the power of Type Safe Scripting -* [**FQuake3**](https://github.com/TIHan/FQuake3/) - integrates F# as an interactive game scripting engine -* [**FCell**](http://fcell.io) - Deliver the power of .NET from within Microsoft Excel -* [**FSharpLint**](https://fsprojects.github.io/FSharpLint/) - Lint tool for F# -* [**FsReveal**](https://fsprojects.github.io/FsReveal/) - FsReveal parses markdown and F# script file and generate reveal.js slides -* [**Elucidate**](https://github.com/rookboom/Elucidate) - Visual Studio extension for rich inlined comments using MarkDown -* [**Fable**](https://fable-compiler.github.io/) - F# to JavaScript Compiler -* [**FSharp.Formatting**](http://tpetricek.github.io/FSharp.Formatting/) - F# tools for generating documentation (Markdown processor and F# code formatter) -* [**FAKE**](https://fsharp.github.io/FAKE/) - "FAKE - F# Make" is a cross platform build automation system -* [**FsLab Journal**](https://visualstudiogallery.msdn.microsoft.com/45373b36-2a4c-4b6a-b427-93c7a8effddb) - Template that makes it easy to do interactive data analysis using F# Interactive and produce nice HTML reports of your work -* [**FarNet.FSharpFar**](https://github.com/nightroman/FarNet/tree/master/FSharpFar) - F# scripting and interactive services in Far Manager - -Contributing and copyright --------------------------- - -This project is a fork of the [fsharp/fsharp](https://github.com/fsharp/fsharp) which has been -modified to expose additional internals useful for creating editors and F# tools and also for -embedding F# interactive. - -The F# source code is copyright by Microsoft Corporation and contributors, the extensions have been -implemented by Dave Thomas, Anh-Dung Phan, Tomas Petricek and other contributors. diff --git a/fcs/docsrc/content/interactive.fsx b/fcs/docsrc/content/interactive.fsx deleted file mode 100644 index 97910b2c6c..0000000000 --- a/fcs/docsrc/content/interactive.fsx +++ /dev/null @@ -1,287 +0,0 @@ -(** ---- -category: tutorial -title: Embedding F# Interactive -menu_order: 7 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Interactive Service: Embedding F# Interactive -============================================= - -This tutorial demonstrates how to embed F# interactive in your application. F# interactive -is an interactive scripting environment that compiles F# code into highly efficient IL code -and executes it on the fly. The F# interactive service allows you to embed F# evaluation in -your application. - -> **NOTE:** There is a number of options for embedding F# Interactive. The easiest one is to use the -`fsi.exe` process and communicate with it using standard input and standard output. In this -tutorial, we look at calling F# Interactive directly through .NET API. However, if you have -no control over the input, it is a good idea to run F# interactive in a separate process. -One reason is that there is no way to handle `StackOverflowException` and so a poorly written -script can terminate the host process. **Remember that while calling F# Interactive through .NET API, -` --shadowcopyreferences` option will be ignored**. For detailed discussion, please take a look at -[this thread](https://github.com/fsharp/FSharp.Compiler.Service/issues/292). -> **NOTE:** If `FsiEvaluationSession.Create` fails with an error saying that `FSharp.Core.dll` cannot be found, -add the `FSharp.Core.sigdata` and `FSharp.Core.optdata` files. More info [here](https://fsharp.github.io/FSharp.Compiler.Service/corelib.html). - -However, the F# interactive service is still useful, because you might want to wrap it in your -own executable that is then executed (and communicates with the rest of your application), or -if you only need to execute limited subset of F# code (e.g. generated by your own DSL). - -Starting the F# interactive ---------------------------- - -First, we need to reference the libraries that contain F# interactive service: -*) - -#r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Interactive.Shell - -(** -To communicate with F# interactive, we need to create streams that represent input and -output. We will use those later to read the output printed as a result of evaluating some -F# code that prints: -*) -open System -open System.IO -open System.Text - -// Initialize output and input streams -let sbOut = new StringBuilder() -let sbErr = new StringBuilder() -let inStream = new StringReader("") -let outStream = new StringWriter(sbOut) -let errStream = new StringWriter(sbErr) - -// Build command line arguments & start FSI session -let argv = [| "C:\\fsi.exe" |] -let allArgs = Array.append argv [|"--noninteractive"|] - -let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() -let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream) - - - -(** -Evaluating and executing code ------------------------------ - -The F# interactive service exposes several methods that can be used for evaluation. The first -is `EvalExpression` which evaluates an expression and returns its result. The result contains -the returned value (as `obj`) and the statically inferred type of the value: -*) -/// Evaluate expression & return the result -let evalExpression text = - match fsiSession.EvalExpression(text) with - | Some value -> printfn "%A" value.ReflectionValue - | None -> printfn "Got no result!" - -(** -This takes a string as an argument and evaluates (i.e. executes) it as F# code. -*) -evalExpression "42+1" // prints '43' - -(** -This can be used in a strongly typed way as follows: -*) - -/// Evaluate expression & return the result, strongly typed -let evalExpressionTyped<'T> (text) = - match fsiSession.EvalExpression(text) with - | Some value -> value.ReflectionValue |> unbox<'T> - | None -> failwith "Got no result!" - -evalExpressionTyped "42+1" // gives '43' - - -(** -The `EvalInteraction` method can be used to evaluate side-effectful operations -such as printing, declarations, or other interactions that are not valid F# expressions, but can be entered in -the F# Interactive console. Such commands include `#time "on"` (and other directives), `open System` -all declarations and other top-level statements. The code -does not require `;;` at the end. Just enter the code that you want to execute: -*) -fsiSession.EvalInteraction "printfn \"bye\"" - - -(** -The `EvalScript` method allows to evaluate a complete .fsx script. -*) - -File.WriteAllText("sample.fsx", "let twenty = 10 + 10") -fsiSession.EvalScript "sample.fsx" - -(** -Catching errors ------------------- - -``EvalExpression``, ``EvalInteraction`` and ``EvalScript`` are awkward if the -code has type checking warnings or errors, or if evaluation fails with an exception. -In these cases you can use ``EvalExpressionNonThrowing``, ``EvalInteractionNonThrowing`` -and ``EvalScriptNonThrowing``. These return a tuple of a result and an array of ``FSharpErrorInfo`` values. -These represent the errors and warnings. The result part is a ``Choice<_,_>`` between an actual -result and an exception. - -The result part of ``EvalExpression`` and ``EvalExpressionNonThrowing`` is an optional ``FSharpValue``. -If that value is not present then it just indicates that the expression didn't have a tangible -result that could be represented as a .NET object. This situation shouldn't actually -occur for any normal input expressions, and only for primitives used in libraries. -*) - -File.WriteAllText("sample.fsx", "let twenty = 'a' + 10.0") -let result, warnings = fsiSession.EvalScriptNonThrowing "sample.fsx" - -// show the result -match result with -| Choice1Of2 () -> printfn "checked and executed ok" -| Choice2Of2 exn -> printfn "execution exception: %s" exn.Message - - -(** -Gives: - - execution exception: Operation could not be completed due to earlier error -*) - -// show the errors and warnings -for w in warnings do - printfn "Warning %s at %d,%d" w.Message w.StartLineAlternate w.StartColumn - -(** -Gives: - - Warning The type 'float' does not match the type 'char' at 1,19 - Warning The type 'float' does not match the type 'char' at 1,17 - -For expressions: -*) - - -let evalExpressionTyped2<'T> text = - let res, warnings = fsiSession.EvalExpressionNonThrowing(text) - for w in warnings do - printfn "Warning %s at %d,%d" w.Message w.StartLineAlternate w.StartColumn - match res with - | Choice1Of2 (Some value) -> value.ReflectionValue |> unbox<'T> - | Choice1Of2 None -> failwith "null or no result" - | Choice2Of2 (exn:exn) -> failwith (sprintf "exception %s" exn.Message) - -evalExpressionTyped2 "42+1" // gives '43' - - -(** -Executing in parallel ------------------- - -By default the code passed to ``EvalExpression`` is executed immediately. To execute in parallel, submit a computation that starts a task: -*) - -open System.Threading.Tasks - -let sampleLongRunningExpr = - """ -async { - // The code of what you want to run - do System.Threading.Thread.Sleep 5000 - return 10 -} - |> Async.StartAsTask""" - -let task1 = evalExpressionTyped>(sampleLongRunningExpr) -let task2 = evalExpressionTyped>(sampleLongRunningExpr) - -(** -Both computations have now started. You can now fetch the results: -*) - - -task1.Result // gives the result after completion (up to 5 seconds) -task2.Result // gives the result after completion (up to 5 seconds) - -(** -Type checking in the evaluation context ------------------- - -Let's assume you have a situation where you would like to typecheck code -in the context of the F# Interactive scripting session. For example, you first -evaluation a declaration: -*) - -fsiSession.EvalInteraction "let xxx = 1 + 1" - -(** - -Now you want to typecheck the partially complete code `xxx + xx` -*) - -let parseResults, checkResults, checkProjectResults = - fsiSession.ParseAndCheckInteraction("xxx + xx") - |> Async.RunSynchronously - -(** -The `parseResults` and `checkResults` have types `ParseFileResults` and `CheckFileResults` -explained in [Editor](editor.html). You can, for example, look at the type errors in the code: -*) -checkResults.Errors.Length // 1 - -(** -The code is checked with respect to the logical type context available in the F# interactive session -based on the declarations executed so far. - -You can also request declaration list information, tooltip text and symbol resolution: -*) -open FSharp.Compiler - -// get a tooltip -checkResults.GetToolTipText(1, 2, "xxx + xx", ["xxx"], FSharpTokenTag.IDENT) - -checkResults.GetSymbolUseAtLocation(1, 2, "xxx + xx", ["xxx"]) // symbol xxx - -(** -The 'fsi' object ------------------- - -If you want your scripting code to be able to access the 'fsi' object, you should pass in an implementation of this object explicitly. -Normally the one from FSharp.Compiler.Interactive.Settings.dll is used. -*) - -let fsiConfig2 = FsiEvaluationSession.GetDefaultConfiguration(fsiSession) - -(** -Collectible code generation ------------------- - -Evaluating code in using FsiEvaluationSession generates a .NET dynamic assembly and uses other resources. -You can make generated code collectible by passing `collectible=true`. However code will only -be collected if there are no outstanding object references involving types, for example -`FsiValue` objects returned by `EvalExpression`, and you must have disposed the `FsiEvaluationSession`. -See also [Restrictions on Collectible Assemblies](https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/dd554932(v=vs.100)#restrictions). - -The example below shows the creation of 200 evaluation sessions. Note that `collectible=true` and -`use session = ...` are both used. - -If collectible code is working correctly, -overall resource usage will not increase linearly as the evaluation progresses. -*) - -let collectionTest() = - - for i in 1 .. 200 do - let defaultArgs = [|"fsi.exe";"--noninteractive";"--nologo";"--gui-"|] - use inStream = new StringReader("") - use outStream = new StringWriter() - use errStream = new StringWriter() - - let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() - use session = FsiEvaluationSession.Create(fsiConfig, defaultArgs, inStream, outStream, errStream, collectible=true) - - session.EvalInteraction (sprintf "type D = { v : int }") - let v = session.EvalExpression (sprintf "{ v = 42 * %d }" i) - printfn "iteration %d, result = %A" i v.Value.ReflectionValue - -// collectionTest() <-- run the test like this diff --git a/fcs/docsrc/content/ja/compiler.fsx b/fcs/docsrc/content/ja/compiler.fsx deleted file mode 100644 index 5b2885fac7..0000000000 --- a/fcs/docsrc/content/ja/compiler.fsx +++ /dev/null @@ -1,98 +0,0 @@ -(** ---- -category: tutorial -title: コンパイラの組み込み -menu_order: 8 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラの組み込み -==================== - -このチュートリアルではF#コンパイラをホストする方法を紹介します。 - -> **注意:** 以下で使用しているAPIは実験的なもので、 - 新しいnugetパッケージの公開に伴って変更される可能性があります。 - -> **注意:** F#コンパイラをホストする方法はいくつかあります。 - 一番簡単な方法は `fsc.exe` のプロセスを使って引数を渡す方法です。 - ---------------------------- - -まず、F# Interactiveサービスを含むライブラリへの参照を追加します: -*) - -#r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.SourceCodeServices -open System.IO - -let scs = FSharpChecker.Create() - -(** -次に、一時ファイルへコンテンツを書き込みます: - -*) -let fn = Path.GetTempFileName() -let fn2 = Path.ChangeExtension(fn, ".fs") -let fn3 = Path.ChangeExtension(fn, ".dll") - -File.WriteAllText(fn2, """ -module M - -type C() = - member x.P = 1 - -let x = 3 + 4 -""") - -(** -そしてコンパイラを呼び出します: -*) - -let errors1, exitCode1 = scs.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |]) |> Async.RunSynchronously - -(** - -エラーが発生した場合は「終了コード」とエラーの配列から原因を特定できます: - -*) -File.WriteAllText(fn2, """ -module M - -let x = 1.0 + "" // a type error -""") - -let errors1b, exitCode1b = scs.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |]) |> Async.RunSynchronously - -if exitCode1b <> 0 then - errors1b - |> Array.iter (printfn "%A") - -(** - -動的アセンブリへのコンパイル -============================ - -コードを動的アセンブリとしてコンパイルすることもできます。 -動的アセンブリはF# Interactiveコードジェネレータでも使用されています。 - -この機能はたとえばファイルシステムが必ずしも利用できないような状況で役に立ちます。 - -出力ファイルの名前を指定する "-o" オプションを指定することは可能ですが、 -実際には出力ファイルがディスク上に書き込まれることはありません。 - -'execute' 引数に 'None' を指定するとアセンブリ用の初期化コードが実行されません。 -*) -let errors2, exitCode2, dynAssembly2 = - scs.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], execute=None) |> Async.RunSynchronously - -(** -'Some' を指定するとアセンブリ用の初期化コードが実行されます。 -*) -let errors3, exitCode3, dynAssembly3 = - scs.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], Some(stdout,stderr)) |> Async.RunSynchronously - diff --git a/fcs/docsrc/content/ja/corelib.fsx b/fcs/docsrc/content/ja/corelib.fsx deleted file mode 100644 index 31b9ab2a42..0000000000 --- a/fcs/docsrc/content/ja/corelib.fsx +++ /dev/null @@ -1,102 +0,0 @@ -(** ---- -category: how-to -title: FSharp.Core.dll についてのメモ -menu_order: 3 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/net461" -(** -コンパイラサービス: FSharp.Core.dll についてのメモ -================================================== - -あなたのアプリケーションとともに FSharp.Core を配布する -------------------------------------------------------- - -FSharp.Compiler.Service.dll を利用するアプリケーションまたはプラグイン・コンポーネントをビルドする際、普通はアプリの一部として FSharp.Core.dll のコピーも含めることになるでしょう。 - -例えば、 ``HostedCompiler.exe`` をビルドする場合、普通はあなたの ``HostedCompiler.exe`` と同じフォルダに FSharp.Core.dll (例えば 4.3.1.0)を配置します。 - -動的コンパイルや動的実行を行う場合、FSharp.Core.optdata と FSharp.Core.sigdata も含める必要があるかもしれませんが、これらについては下記の指針をご覧ください。 - -あなたのアプリケーションにリダイレクトをバインドする ----------------------------------------------------- - -FSharp.Compiler.Service.dll コンポーネントは FSharp.Core 4.3.0.0 に依存しています。通例、あなたのアプリケーションはこれより後のバージョンの FSharp.Core をターゲットにしており、FSharp.Core 4.3.0.0 をあなたのアプリケーションで用いる FSharp.Core.dll の最終バージョンにちゃんと転送させるように[バインド リダイレクト](https://msdn.microsoft.com/ja-jp/library/7wd6ex19(v=vs.110).aspx)が必要になるでしょう。バインド リダイレクト ファイルは通常ビルドツールによって自動的に生成されます。そうでない場合、下記のようなファイル(あなたのツールが ``HostedCompiler.exe`` という名前で、バインド リダイレクト ファイルが ``HostedCompiler.exe.config`` という名前の場合)を使うことが出来ます。 - - - - - - - - - - - - - - - - - -どの FSharp.Core と .NET フレームワークがコンパイル時に参照される? --------------------------------------- - -FSharp.Combiler.Service コンポーネントは多かれ少なかれ、F#コードを コンパイルするために使われるに過ぎません。特に、コマンドライン引数(あなたのツールを実行するために使われる FSharp.Core や .NET フレームワークとは違います)に明示的に FSharp.Core および/またはフレームワークのアセンブリを参照することが出来ます。 - -特定の FSharp.Core および .NET フレームワーク アセンブリ、またはそのいずれかをターゲットにする場合、 ``--noframework`` 引数と適切なコマンドライン引数を使います: - - [] - let fsharpCorePath = - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" - let errors2, exitCode2 = - scs.Compile( - [| "fsc.exe"; "--noframework"; - "-r"; fsharpCorePath; - "-r"; @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"; - "-o"; fn3; - "-a"; fn2 |]) - -これらのアセンブリが配置されている場所を指定する必要があります。クロスプラットフォームに対応した方法でDLL を配置して、それらをコマンドライン引数に変換する最も簡単な方法は、[F# プロジェクトファイルをクラックする](https://fsharp.github.io/FSharp.Compiler.Service/ja/project.html)ことです。 -自分で SDK のパスを処理する代わりに、[FSharp.Compiler.Service.dll 用のテスト](https://github.com/fsharp/FSharp.Compiler.Service/blob/8a943dd3b545648690cb3bed652a469bdb6dd869/tests/service/Common.fs#L54)で使用しているようなヘルパー関数も用意されています。 - - -スクリプトを処理しているか ``GetCheckOptionsFromScriptRoot`` を使っている場合 -------------------------------------------------------------------------- - -もし SDK 配置先にある FSharp.Core.dll を明示的に参照 *していない* 場合、または ``FsiEvaluationSession`` や ``GetCheckOptionsFromScriptRoot`` を使用してスクリプトを処理している場合、以下のいずれかの方法により、暗黙的にFSharp.Core が参照されます: - -1. ``System.Reflection.Assembly.GetEntryAssembly()`` によって返されるホストアセンブリから静的に参照されたFSharp.Core.dll のバージョン - -2. ホストアセンブリに FSharp.Core への静的な参照がない場合、 - - - FSharp.Compiler.Service 0.x シリーズでは、FSharp.Core バージョン 4.3.0.0 への参照が付与されます - - - FSharp.Compiler.Service 1.3.1.x (F# 3.1 シリーズ)では、FSharp.Core バージョン 4.3.1.0 への参照が付与されます - - - FSharp.Compiler.Service 1.4.0.x (F# 4.0 シリーズ)では、FSharp.Core バージョン 4.4.0.0 への参照が付与されます - -FSharp.Core.optdata と FSharp.Core.sigdata を含める必要はありますか? --------------------------------------- - -もしあなたのコンパイル引数が SDK 配置先にある FSharp.Core.dll を明示的に参照している場合、FSharp.Core.sigdata と FSharp.Core.optdata はその DLL と同じフォルダになければいけません(これらのファイルがインストールされていない場合、F# SDKの インストールに問題があります)。もしコンパイル引数で常に明示的に参照していたなら、FSharp.Core.optdata と FSharp.Core.sigdata はあなたのアプリケーションの一部として含める必要は *ありません* 。 - -もしあなたが暗黙的な参照(例えば、上記のスクリプト処理など)に頼っているのなら、これはあなたのツールがアプリケーションの一部として FSharp.Core.dll を参照しているかもしれない、ということです。この場合、FSharp.Core.optdata および FSharp.Core.sigdata が FSharp.Core.dll と同じフォルダに見つからないというエラーが発生するかもしれません。 **もしあなたがアプリケーションに含めている FSharp.Core.dll を暗黙的に参照したいのであれば、FSharp.Core.sigdata と FSharp.Core.optdata もアプリケーションに追加する2つのファイルとして追加しましょう。** ``CombileToDynamicAssembly`` を使用する場合、この問題によって[アセンブリ解決中のスタックオーバーフロー](https://github.com/fsharp/FSharp.Compiler.Service/issues/258)も引き起こされるでしょう。 - -動的コンパイルと動的コード実行を行うツール(例: ``HostedExecution.exe``)はしばしば FSharp.Core.dll を暗黙的に参照するようになっています。 -これはつまり通常 FSharp.Core.optdata と FSharp.Core.sigdata を含んでいるということです。 - -要約 -------- - -このデザインノートでは3つのポイントを検討しました: - -- どの FSharp.Core.dll があなたのコンパイルツールを実行するのに使われるか -- あなたのコンパイルツールを実行するのに使われる FSharp.Core.dll へのバインド リダイレクトを設定する方法 -- あなたのツールによって実行されるチェック時およびコンパイル時にどの FSharp.Core.dll および/またはフレームワークのアセンブリが参照されるか - -*) diff --git a/fcs/docsrc/content/ja/devnotes.md b/fcs/docsrc/content/ja/devnotes.md deleted file mode 100644 index d7398538e5..0000000000 --- a/fcs/docsrc/content/ja/devnotes.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: 開発者用メモ -category: explanation -menu_order: 2 -language: ja ---- - - -開発者用メモ -============ - -F#コンパイラの修正版クローンではクライアントの編集機能やF#コンパイラの埋め込み、 -F# Interactiveをサービスとして動作させるための機能が追加されています。 - -## コンポーネント - -まず `FSharp.Compiler.Service.dll` というコンポーネントがあります。 -このコンポーネントにはリファクタリングやその他の編集ツールが完全なF# ASTやパーサ機能を利用できるように -可視性を変更するというマイナーな変更だけが加えられています。 -主な狙いとしては、メインコンパイラの安定版かつドキュメントが備えられたフォークを用意することにより、 -このコンポーネントにある共通コードを様々なツールで共有できるようにすることです。 - -2つ目のコンポーネントはF# Interactiveをサービスとして組み込めるようにするためのもので、 -`fsi.exe` のソースコードに多数の変更が加えられており、 -`EvalExpression` や `EvalInteraction` といった関数が追加されています。 - -このレポジトリは以下の点を除けば 'fsharp' と **同一** です: - - - `FSharp.Compiler.Service.dll` のビルド、特に以下の点に関する変更: - - アセンブリ名の変更 - - `FSharp.Compiler.Service.dll` のみビルドされる - - ブートストラッパーやプロトコンパイラを使用しない。 - F#コンパイラがインストール済みであることを想定。 - - - FAKEを使用するビルドスクリプト。 - すべてのコードのビルドとNuGetパッケージ、ドキュメントの生成、 - NuGetパッケージの配布に必要なファイルの生成などがFAKEによって行われる。 - ([F# プロジェクト スキャフォールド](https://github.com/fsprojects/FSharp.ProjectScaffold) に準拠) - - - 新機能追加のためにコンパイラのソースコードを変更。 - また、評価用関数を実装するためにF# Interactiveサービスに対する変更を追加。 - - - F#編集用クライアントで使用されるAPIを改善するためにコンパイラのソースコードを変更。 - - - コンパイラサービスAPIに新機能を追加するためにコンパイラのソースコードを変更。 - -`fsharp/fsharp` のレポジトリに言語あるいはコンパイラが追加コミットされた場合、 -それらはこのレポジトリにもマージされるべきで、同時に新しいNuGetパッケージもリリースする必要があります。 - -## ビルドとNuGet - -ビルドの手順は [F# プロジェクト スキャフォールド](https://github.com/fsprojects/FSharp.ProjectScaffold) -で推奨されているものに準じます。 -プロジェクトを独自にビルドする場合、以下の手順に従ってください: - - [lang=text] - git clone https://github.com/fsharp/FSharp.Compiler.Service - cd FSharp.Compiler.Service - -次に、(Windowsであれば) `build.cmd` または(LinuxやMac OSであれば) `build.sh` を実行してすべてをビルドします。 -ファイルは `bin` ディレクトリ内に出力されます。 -ドキュメントやNuGetパッケージもビルドしたい場合には `build Release` を実行します -(このコマンドはGitHub上のドキュメントを更新しようとしますが、GitHubのレポジトリに適切な権限を持っている場合にのみ有効です)。 - -## クライアント - -このコンポーネントは以下のようなツールで使用されています: - - * [Fantomas](https://github.com/dungpa/fantomas) - F# コードフォーマットツール - * [Fsharp-Refactor](https://github.com/Lewix/fsharp-refactor) - F#用リファクタリングツール - * [FSharpbinding](https://github.com/fsharp/fsharpbinding) - Xamarin Studio バインディング - * [F# Snippets web site](http://fssnip.net/) - F# 版のpastebin - * [F# ACE Code Editor](https://github.com/BayardRock/FSharpWebIntellisense/) - Web上のF#編集ツール diff --git a/fcs/docsrc/content/ja/editor.fsx b/fcs/docsrc/content/ja/editor.fsx deleted file mode 100644 index 70da7c6c5f..0000000000 --- a/fcs/docsrc/content/ja/editor.fsx +++ /dev/null @@ -1,280 +0,0 @@ -(** ---- -category: tutorial -title: エディタサービス -menu_order: 3 -language: ja - ---- -*) - -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラサービス: エディタサービス -==================================== - -このチュートリアルはF#コンパイラによって公開されるエディタサービスの -使用方法についてのデモです。 -このAPIにより、Visual StudioやXamarin Studio、EmacsなどのF#エディタ内において、 -自動補完機能やツールチップ表示、引数情報のヘルプ表示、括弧の補完などの機能を -実装することができます -(詳細については [fsharpbindings](https://github.com/fsharp/fsharpbinding) のプロジェクトを参照してください)。 -[型無しASTを使用するチュートリアル](untypedtree.html) と同じく、 -今回も `FSharpChecker` オブジェクトを作成するところから始めます。 - -> **注意:** 以下で使用しているAPIは試験的なもので、最新バージョンのnugetパッケージの -公開に伴って変更されることがあります。 - -サンプルソースコードの型チェック --------------------------------- - -[前回の(型無しASTを使った)チュートリアル](untypedtree.html) と同じく、 -`FSharp.Compiler.Service.dll` への参照を追加した後に特定の名前空間をオープンし、 -`FSharpChecker` のインスタンスを作成します: - -*) -// F#コンパイラAPIを参照 -#r "FSharp.Compiler.Service.dll" - -open System -open FSharp.Compiler.SourceCodeServices - -// インタラクティブチェッカーのインスタンスを作成 -let checker = FSharpChecker.Create() - -(** - -[前回](untypedtree.html) 同様、 -コンパイラに渡されるファイルとしては特定の入力値だけであるという -コンテキストを想定するため、 `GetCheckOptionsFromScriptRoot` を使います -(この入力値はコンパイラによってスクリプトファイル、 -あるいはスタンドアロンのF#ソースコードとみなされます)。 - -*) -// サンプルの入力となる複数行文字列 -let input = - """ -open System - -let foo() = -let msg = String.Concat("Hello"," ","world") -if true then -printfn "%s" msg. -""" -// 入力値の分割とファイル名の定義 -let inputLines = input.Split('\n') -let file = "/home/user/Test.fsx" - -let projOptions, _errors1 = checker.GetProjectOptionsFromScript(file, input) |> Async.RunSynchronously - -let parsingOptions, _errors2 = checker.GetParsingOptionsFromProjectOptions(projOptions) - -(** - -型チェックを実行するには、まず `ParseFile` を使って -入力値をパースする必要があります。 -このメソッドを使うと [型無しAST](untypedtree.html) にアクセスできるようになります。 -しかし今回は完全な型チェックを実行するため、続けて `CheckFileInProject` -を呼び出す必要があります。 -このメソッドは `ParseFile` の結果も必要とするため、 -たいていの場合にはこれら2つのメソッドをセットで呼び出すことになります。 - -*) -// パースを実行 -let parseFileResults = - checker.ParseFile(file, input, parsingOptions) - |> Async.RunSynchronously -(** -`TypeCheckResults` に備えられた興味深い機能の紹介に入る前に、 -サンプル入力に対して型チェッカーを実行する必要があります。 -F#コードにエラーがあった場合も何らかの型チェックの結果が返されます -(ただし間違って「推測された」結果が含まれることがあります)。 -*) - -// 型チェックを実行 -let checkFileAnswer = - checker.CheckFileInProject(parseFileResults, file, 0, input, projOptions) - |> Async.RunSynchronously - -(** -あるいは `ParseAndCheckFileInProject` を使用すれば1つの操作で両方のチェックを行うことができます: -*) - -let parseResults2, checkFileAnswer2 = - checker.ParseAndCheckFileInProject(file, 0, input, projOptions) - |> Async.RunSynchronously - -(** -この返り値は `CheckFileAnswer` 型で、この型に機能的に興味深いものが揃えられています... -*) - -let checkFileResults = - match checkFileAnswer with - | FSharpCheckFileAnswer.Succeeded(res) -> res - | res -> failwithf "パースが完了していません... (%A)" res - -(** - -今回は単に(状況に応じて)「Hello world」と表示するだけの -単純な関数の型をチェックしています。 -最終行では値 `msg` に対する補完リストを表示することができるように、 -`msg.` というようにドットを追加している点に注意してください -(今回の場合は文字列型に対する様々なメソッドが期待されます)。 - - -型チェックの結果を使用する --------------------------- - -では `TypeCheckResults` 型で公開されているAPIをいくつか見ていきましょう。 -一般的に、F#ソースコードエディタサービスの実装に必要な機能は -ほとんどこの型に備えられています。 - -### ツールチップの取得 - -ツールチップを取得するには `GetToolTipTextAlternate` メソッドを使用します。 -このメソッドには行数と文字オフセットを指定します。 -いずれも0から始まる数値です。 -サンプルコードでは3行目(0行目は空白行)、インデックス7にある文字 `f` から始まる関数 -`foo` のツールチップを取得しています -(ツールチップは識別子の中であれば任意の位置で機能します)。 - -またこのメソッドにはトークンタグを指定する必要もあります。 -トークンタグは一般的には `IDENT` を指定して、識別子に対する -ツールチップが取得できるようにします -(あるいは `#r "..."` を使用している場合にはアセンブリの完全パスを表示させるように -することもできるでしょう)。 - -*) -// 最後の引数に指定する、IDENTトークンのタグを取得 -open FSharp.Compiler - -// 特定の位置におけるツールチップを取得 -let tip = checkFileResults.GetToolTipText(4, 7, inputLines.[1], ["foo"], FSharpTokenTag.Identifier) -printfn "%A" tip - -(** - -> **注意:** `GetToolTipTextAlternate` は古い関数 `GetToolTipText` に代わるものです。 -`GetToolTipText` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 - -この関数には位置とトークンの種類の他にも、 -(ソースコードの変更時に役立つように)特定行の現在の内容と、 -現時点における完全修飾された `名前` を表す文字列のリストを指定する必要があります。 -たとえば完全修飾名 `System.Random` という名前を持った識別子 `Random` に対する -ツールチップを取得する場合、 `Random` という文字列が現れる場所の他に、 -`["System"; "Random"]` という値を指定する必要があります。 - -返り値の型は `ToolTipText` で、この型には `ToolTipElement` という -判別共用体が含まれます。 -この共用体は、コンパイラによって返されたツールチップの種類に応じて異なります。 - -### 自動補完リストの取得 - -次に紹介する `TypeCheckResults` のメソッドを使用すると、 -特定の位置における自動補完機能を実装できます。 -この機能は任意の識別子上、 -あるいは(特定のスコープ内で利用可能な名前の一覧を取得する場合には)任意のスコープ、 -あるいは特定のオブジェクトにおけるメンバーリストを取得する場合には -`.` の直後で呼び出すことができます。 -今回は文字列の値 `msg` に対するメンバーリストを取得することにします。 - -そのためには最終行( `printfn "%s" msg.` で終わっている行)にある -シンボル `.` の位置を指定して `GetDeclarationListInfo` を呼び出します。 -オフセットは1から始まるため、位置は `7, 23` になります。 -また、テキストが変更されていないことを表す関数と、 -現時点において補完する必要がある識別子を指定する必要もあります。 -*) -// 特定の位置における宣言(自動補完)を取得する -let decls = - checkFileResults.GetDeclarationListInfo - (Some parseFileResults, 7, inputLines.[6], PartialLongName.Empty 23, (fun _ -> []), fun _ -> false) - |> Async.RunSynchronously - -// 利用可能な項目を表示 -for item in decls.Items do - printfn " - %s" item.Name -(** - -> **注意:** `GetDeclarationListInfo` は古い関数 `GetDeclarations` に代わるものです。 -`GetDeclarations` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 -また、将来的には現在の `GetDeclarations` が削除され、 `GetDeclarationListInfo` が -`GetDeclarations` になる予定です。 - -コードを実行してみると、 `Substring` や `ToUpper` 、 `ToLower` といった -文字列に対するいつものメソッドのリストが取得できていることでしょう。 -`GetDeclarations` の5,6番目の引数( `[]` および `"msg"` )には -自動補完用のコンテキストを指定します。 -今回の場合は完全名 `msg` に対する補完を行いましたが、 -たとえば `["System"; "Collections"]` と `"Generic"` というように -完全修飾された名前空間を指定して補完リストを取得することもできます。 - -### 引数の情報を取得する - -次に一般的なエディタの機能としては、メソッドのオーバーロードに -関する情報を提供するというものでしょう。 -サンプルコード中では多数のオーバーロードを持った `String.Concat` を使っています。 -このオーバーロード一覧は `GetMethods` で取得できます。 -先ほどと同じく、このメソッドには対象とする項目の位置を0基準のオフセットで指定し -(今回は `String.Concat` 識別子の右側の終端)、 -識別子もやはり指定します -(これにより、コンパイラはソースコードが変更された場合でも最新の情報に追従できます): - -*) -//String.Concatメソッドのオーバーロードを取得する -let methods = - checkFileResults.GetMethods(5, 27, inputLines.[4], Some ["String"; "Concat"]) |> Async.RunSynchronously - -// 連結された引数リストを表示 -for mi in methods.Methods do - [ for p in mi.Parameters -> p.Display ] - |> String.concat ", " - |> printfn "%s(%s)" methods.MethodName -(** -ここでは `Display` プロパティを使用することで各引数に対する -アノテーションを取得しています。 -このプロパティは `arg0: obj` あるいは `params args: obj[]` 、 -`str0: string, str1: string` といった情報を返します。 -これらの引数を連結した後、メソッド名とメソッドの型情報とともに表示させています。 -*) - -(** - -## 非同期操作と即時操作 - -`CheckFileInProject` が非同期操作であることを気にされる人もいるかもしれません。 -これはつまり、F#コードの型チェックにはある程度時間がかかることを示唆しています。 -F#コンパイラは型チェックを(自動的に)バックグラウンドで処理を進めているため、 -`CheckFileInProject` メソッドを呼び出すと非同期操作が返されることになります。 - -また、 `CheckFileInProjectIfReady` というメソッドもあります。 -このメソッドは、型チェックの操作が即座に開始できない場合、 -つまりプロジェクト内の他のファイルがまだ型チェックされていない場合には -処理が即座に返されます。 -この場合、バックグラウンドワーカーは一定期間他の作業を進めるか、 -`FileTypeCheckStateIsDirty` イベントが発生するまでは -ファイルに対する型チェックを諦めるか、どちらか選択することになります。 - -> [fsharpbinding](https://github.com/fsharp/fsharpbinding) プロジェクトには -1つのF#エージェント経由ですべてのリクエストをバックグラウンドワークとして -処理するような、より複雑な具体例も含まれています。 -エディタの機能を実装する方法としてはこちらのほうが適切です。 - -*) - - -(** -まとめ ------- - -`CheckFileAnswer` にはチュートリアルで紹介していないような便利なメソッドが -多数揃えられています。 -これらを使用すれば特定の識別子に対する宣言の位置を取得したり、 -付加的な色情報を取得したりすることができます -(F# 3.1では式ビルダーの識別子やクエリ演算子も着色表示されます)。 - -最後に、直接.NET APIを呼び出すことができないようなエディタに対するサポート機能を -実装する場合、ここで紹介した様々な機能を -[FSharp.AutoComplete](https://github.com/fsharp/fsharpbinding/tree/master/FSharp.AutoComplete) -プロジェクトのコマンドラインインターフェイス経由で呼び出すこともできます。 -*) diff --git a/fcs/docsrc/content/ja/filesystem.fsx b/fcs/docsrc/content/ja/filesystem.fsx deleted file mode 100644 index 9157ffd1d0..0000000000 --- a/fcs/docsrc/content/ja/filesystem.fsx +++ /dev/null @@ -1,184 +0,0 @@ -(** ---- -category: tutorial -title: ファイルシステム仮想化 -menu_order: 9 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラサービス: ファイルシステム仮想化 -========================================== - -`FSharp.Compiler.Service` にはファイルシステムを表すグローバル変数があります。 -この変数を設定するこにより、ファイルシステムが利用できない状況でも -コンパイラをホストすることができるようになります。 - -> **注意:** 以下で使用しているAPIは実験的なもので、 - 新しいnugetパッケージの公開に伴って変更される可能性があります。 - -FileSystemの設定 ----------------- - -以下の例ではディスクからの読み取りを行うような実装をファイルシステムに設定しています: -*) -#r "FSharp.Compiler.Service.dll" -open System -open System.IO -open System.Collections.Generic -open System.Text -open FSharp.Compiler.AbstractIL.Internal.Library - -let defaultFileSystem = Shim.FileSystem - -let fileName1 = @"c:\mycode\test1.fs" // 注意: 実際には存在しないファイルのパス -let fileName2 = @"c:\mycode\test2.fs" // 注意: 実際には存在しないファイルのパス - -type MyFileSystem() = - let file1 = """ -module File1 - -let A = 1""" - let file2 = """ -module File2 -let B = File1.A + File1.A""" - let files = dict [(fileName1, file1); (fileName2, file2)] - - interface IFileSystem with - // 読み取りおよび書き込み用にファイルをオープンする機能を実装 - member __.FileStreamReadShim(fileName) = - match files.TryGetValue fileName with - | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream - | _ -> defaultFileSystem.FileStreamReadShim(fileName) - - member __.FileStreamCreateShim(fileName) = - defaultFileSystem.FileStreamCreateShim(fileName) - - member __.IsStableFileHeuristic(fileName) = - defaultFileSystem.IsStableFileHeuristic(fileName) - - member __.FileStreamWriteExistingShim(fileName) = - defaultFileSystem.FileStreamWriteExistingShim(fileName) - - member __.ReadAllBytesShim(fileName) = - match files.TryGetValue fileName with - | true, text -> Encoding.UTF8.GetBytes(text) - | _ -> defaultFileSystem.ReadAllBytesShim(fileName) - - // 一時パスおよびファイルのタイムスタンプに関連する機能を実装 - member __.GetTempPathShim() = - defaultFileSystem.GetTempPathShim() - - member __.GetLastWriteTimeShim(fileName) = - defaultFileSystem.GetLastWriteTimeShim(fileName) - - member __.GetFullPathShim(fileName) = - defaultFileSystem.GetFullPathShim(fileName) - - member __.IsInvalidPathShim(fileName) = - defaultFileSystem.IsInvalidPathShim(fileName) - - member __.IsPathRootedShim(fileName) = - defaultFileSystem.IsPathRootedShim(fileName) - - // ファイルの存在確認および削除に関連する機能を実装 - member __.SafeExists(fileName) = - files.ContainsKey(fileName) || defaultFileSystem.SafeExists(fileName) - - member __.FileDelete(fileName) = - defaultFileSystem.FileDelete(fileName) - - // アセンブリのロードに関連する機能を実装。 - // 型プロバイダやF# Interactiveで使用される。 - member __.AssemblyLoadFrom(fileName) = - defaultFileSystem.AssemblyLoadFrom fileName - - member __.AssemblyLoad(assemblyName) = - defaultFileSystem.AssemblyLoad assemblyName - -let myFileSystem = MyFileSystem() -Shim.FileSystem <- MyFileSystem() - -(** - -FileSystemによるコンパイルの実行 --------------------------------- - -*) -open FSharp.Compiler.SourceCodeServices - -let checker = FSharpChecker.Create() -let projectOptions = - let allFlags = - [| yield "--simpleresolution"; - yield "--noframework"; - yield "--debug:full"; - yield "--define:DEBUG"; - yield "--optimize-"; - yield "--doc:test.xml"; - yield "--warn:3"; - yield "--fullpaths"; - yield "--flaterrors"; - yield "--target:library"; - let references = - [ @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll"; - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll"; - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll"; - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"] - for r in references do - yield "-r:" + r |] - - { ProjectFileName = @"c:\mycode\compilation.fsproj" // 現在のディレクトリで一意な名前を指定 - ProjectId = None - SourceFiles = [| fileName1; fileName2 |] - OriginalLoadReferences = [] - ExtraProjectInfo=None - Stamp = None - OtherOptions = allFlags - ReferencedProjects=[| |] - IsIncompleteTypeCheckEnvironment = false - UseScriptResolutionRules = true - LoadTime = System.DateTime.Now // 'Now' を指定して強制的に再読込させている点に注意 - UnresolvedReferences = None } - -let results = checker.ParseAndCheckProject(projectOptions) |> Async.RunSynchronously - -results.Errors -results.AssemblySignature.Entities.Count //2 -results.AssemblySignature.Entities.[0].MembersFunctionsAndValues.Count //1 -results.AssemblySignature.Entities.[0].MembersFunctionsAndValues.[0].DisplayName // "B" - -(** -まとめ ------- -このチュートリアルでは FSharp.Compiler.Service コンポーネントで使用される -ファイルシステムに注目して、グローバルな設定を変更する方法について紹介しました。 - -このチュートリアルの執筆時点では、以下に列挙したSystem.IOの操作に対しては -仮想化されたファイルシステムAPIが用意されない予定になっています。 -将来のバージョンのコンパイラサービスではこれらのAPIが追加されるかもしれません。 - - - Path.Combine - - Path.DirectorySeparatorChar - - Path.GetDirectoryName - - Path.GetFileName - - Path.GetFileNameWithoutExtension - - Path.HasExtension - - Path.GetRandomFileName (アセンブリ内にコンパイル済みwin32リソースを生成する場合にのみ使用される) - -**注意:** `SourceCodeServices` API内の一部の操作では、 -引数にファイルの内容だけでなくファイル名を指定する必要があります。 -これらのAPIにおいて、ファイル名はエラーの報告のためだけに使用されます。 - -**注意:** 型プロバイダーコンポーネントは仮想化されたファイルシステムを使用しません。 - -**注意:** コンパイラサービスは `--simpleresolution` が指定されていない場合、 -MSBuildを使ってアセンブリの解決を試みることがあります。 -`FileSystem` APIを使用する場合、通常はコンパイラへのフラグとして -`--simpleresolution` を指定することになります。 -それと同時に `--noframework` を指定します。 -.NETアセンブリに対するすべての参照を明示的に指定する必要があるでしょう。 -*) diff --git a/fcs/docsrc/content/ja/index.md b/fcs/docsrc/content/ja/index.md deleted file mode 100644 index 17622c8d7c..0000000000 --- a/fcs/docsrc/content/ja/index.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: F# コンパイラサービス -category: explanation -menu_order: 1 -language: ja ---- - -F# コンパイラサービス -===================== - -F# コンパイラサービスパッケージはF# コンパイラのソースコードから派生したコンポーネントです。 -このソースコードにはF# 言語バインディングを実装するための機能や、 -コンパイラやリファクタリングツールを元にしたツールを作成するための機能が追加されています。 -また、パッケージには自身のアプリケーションにF# スクリプトを埋め込む際に利用できるような -F# インタラクティブサービスも含まれています。 - -
-
-
-
- F# コンパイラサービスパッケージは NuGet経由でインストールできます: -
PM> Install-Package FSharp.Compiler.Service
-
-
-
-
- -利用可能なサービス ------------------- - -プロジェクトには現在以下のサービスがあり、いずれもテストされ、 -このページから参照可能なドキュメントがあります。 -ライブラリには他にも使用可能な公開APIがありますが、 -ここではドキュメント化されていません。 - - * [** F# 言語トークナイザ **](tokenizer.html) - F#ソースコードをトークンのストリームへと変換します。 - この機能はソースコードを色つき表示したり、基本的なツールを作成するような場合に有効です。 - ネストされたコメントや文字列なども適切に処理できます。 - - * [** 型無しASTの処理 **](untypedtree.html) - この機能を使うことで型無し抽象構文木(AST: abstract syntax tree)にアクセスできます。 - 型無しASTとは型情報を含まない解析済みのF#の文法を表すもので、 - コードフォーマットやその他様々な単純処理に利用できます。 - - * [** エディタ (IDE) サービスの使用 **](editor.html) - 自動補完やツールチップ、 - 引数の情報などを表示するための機能があります。 - この機能を使うと、F#サポート機能をエディタに追加したり、F#コードから - 何らかの型情報を取得したりすることができるようになります。 - - * [** シグネチャや型、解決済みのシンボルの処理 **](symbols.html) - - 解決済みのシンボルや推測された型の表現、アセンブリ全体のシグネチャなどを - 型のチェック時に返すような多数のサービスがあります。 - - * [** 複数プロジェクトやプロジェクト全体の処理 **](project.html) - - すべてのプロジェクトに対するチェックを実行することにより、 - プロジェクト全体の解析結果を使って\[すべての参照の検索\] のような - 機能を実現できます。 - - * [** F# Interactive のホスティング **](interactive.html) - 自身の.NETコードから - F# Interactiveを.NETライブラリとして呼び出すことができるようになります。 - このAPIを使用すると、自身のプロジェクト内でF#をスクリプト言語として - 埋め込むことができるようになります。 - - * [** F#コンパイラのホスティング **](compiler.html) - F# コンパイラを - 呼び出すコードを組み込むことができます。 - - * [** ファイルシステムAPI **](filesystem.html) - `FSharp.Compiler.Service` コンポーネントには - ファイルシステムを表すグローバル変数が定義されています。 - この変数を設定することによって、ファイルシステムが使用できない状況であっても - コンパイラをホストすることができるようになります。 - -> **注釈:** FSharp.Compiler.Service.dll には既存のものと重複する機能が多数あるため、 - 将来的にはもっときちんとした形に変更されます。 - そのため、これらのサービスを使用するAPIには破壊的変更が加えられる可能性があります。 - -貢献および著作権について ------------------------- - -このプロジェクトは [fsharp/fsharp](https://github.com/fsharp/fsharp) からフォークしたもので、 -そこへさらにエディタやF#用ツール、F# Interactiveの組み込みに必要となる機能を -追加したものです。 - -F# ソースコードの著作権はMicrosoft Corporationおよび貢献者に、 -拡張機能の著作権は Dave Thomas, Anh-Dung Phan, Tomas Petricek および -その他の貢献者にあります。 -ソースコードは [MIT ライセンス](https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE) の元に公開されています。 diff --git a/fcs/docsrc/content/ja/interactive.fsx b/fcs/docsrc/content/ja/interactive.fsx deleted file mode 100644 index 34e86dc27e..0000000000 --- a/fcs/docsrc/content/ja/interactive.fsx +++ /dev/null @@ -1,308 +0,0 @@ -(** ---- -category: tutorial -title: F# Interactiveの組み込み -menu_order: 7 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -インタラクティブサービス: F# Interactiveの組み込み -================================================== - -このチュートリアルでは、独自のアプリケーションに -F# Interactiveを組み込む方法について紹介します。 -F# Interactiveは対話式のスクリプティング環境で、 -F#コードを高度に最適化されたILコードへとコンパイルしつつ、 -それを即座に実行することができます。 -F# Interactiveサービスを使用すると、独自のアプリケーションに -F#の評価機能を追加できます。 - -> **注意:** F# Interactiveは様々な方法で組み込むことができます。 - 最も簡単な方法は `fsi.exe` プロセスとの間で標準入出力経由でやりとりする方法です。 - このチュートリアルではF# Interactiveの機能を.NET APIで - 直接呼び出す方法について紹介します。 - ただし入力用のコントロールを備えていない場合、別プロセスでF# Interactiveを - 起動するのはよい方法だといえます。 - 理由の1つとしては `StackOverflowException` を処理する方法がないため、 - 出来の悪いスクリプトによってはホストプロセスが停止させられてしまう - 場合があるからです。 - **.NET APIを通じてF# Interactiveを呼び出すとしても、 `--shadowcopyreferences` - オプションは無視されることを覚えておきましょう。** - 詳細な議論については、[このスレッド](https://github.com/fsharp/FSharp.Compiler.Service/issues/292) - に目を通してみてください。 - **注意:** もし`FSharp.Core.dll` が見つからないというエラーが出て `FsiEvaluationSession.Create` - に失敗した場合、 `FSharp.Core.sigdata` と `FSharp.Core.optdata` というファイルを追加してください。 - 詳しい内容は[こちら](https://fsharp.github.io/FSharp.Compiler.Service/ja/corelib.html) - にあります。 - -しかしそれでもF# InteractiveサービスにはF# Interactiveを実行ファイルに埋め込んで -実行出来る(そしてアプリケーションの各機能とやりとり出来る)、あるいは -機能限定されたF#コード(たとえば独自のDSLによって生成されたコード)だけを -実行させることが出来るという便利さがあります。 - -F# Interactiveの開始 --------------------- - -まずF# Interactiveサービスを含むライブラリへの参照を追加します: -*) - -#r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Interactive.Shell - -(** -F# Interactiveとやりとりするには、入出力を表すストリームを作成する必要があります。 -これらのストリームを使用することで、 -いくつかのF#コードに対する評価結果を後から出力することができます: -*) -open System -open System.IO -open System.Text - -// 入出力のストリームを初期化 -let sbOut = new StringBuilder() -let sbErr = new StringBuilder() -let inStream = new StringReader("") -let outStream = new StringWriter(sbOut) -let errStream = new StringWriter(sbErr) - -// コマンドライン引数を組み立てて、FSIセッションを開始する -let argv = [| "C:\\fsi.exe" |] -let allArgs = Array.append argv [|"--noninteractive"|] - -let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() -let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream) - -(** -コードの評価および実行 ----------------------- - -F# Interactiveサービスにはコードを評価するためのメソッドがいくつか用意されています。 -最初の1つは `EvalExpression` で、式を評価してその結果を返します。 -結果には戻り値が( `obj` として)含まれる他、値に対して静的に推論された型も含まれます: -*) -/// 式を評価して結果を返す -let evalExpression text = - match fsiSession.EvalExpression(text) with - | Some value -> printfn "%A" value.ReflectionValue - | None -> printfn "結果が得られませんでした!" - -(** -これは引数に文字列を取り、それをF#コードとして評価(つまり実行)します。 -*) -evalExpression "42+1" // '43' を表示する - -(** -これは以下のように強く型付けされた方法で使うことができます: -*) - -/// 式を評価して、強く型付けされた結果を返す -let evalExpressionTyped<'T> (text) = - match fsiSession.EvalExpression(text) with - | Some value -> value.ReflectionValue |> unbox<'T> - | None -> failwith "結果が得られませんでした!" - -evalExpressionTyped "42+1" // '43' になる - - -(** -`EvalInteraction` メソッドは画面出力機能や宣言、 -F#の式としては不正なものの、F# Interactiveコンソールには入力できるようなものなど、 -副作用を伴う命令を評価する場合に使用できます。 -たとえば `#time "on"` (あるいはその他のディレクティブ)や `open System` 、 -その他の宣言やトップレベルステートメントなどが該当します。 -指定するコードの終端に `;;` を入力する必要はありません。 -実行したいコードだけを入力します: -*) -fsiSession.EvalInteraction "printfn \"bye\"" - - -(** -`EvalScript` メソッドを使用すると、完全な .fsx スクリプトを評価することができます。 -*) - -File.WriteAllText("sample.fsx", "let twenty = 10 + 10") -fsiSession.EvalScript "sample.fsx" - -(** -例外処理 --------- - -コードに型チェックの警告やエラーがあった場合、または評価して例外で失敗した場合、 -`EvalExpression` 、 `EvalInteraction` そして `EvalScript` ではあまりうまく処理されません。 -これらのケースでは、 `EvalExpressionNonThrowing` 、 `EvalInteractionNonThrowing` -そして `EvalScriptNonThrowing` を使うことが出来ます。 -これらは結果と `FSharpErrorInfo` 値の配列の組を返します。 -これらはエラーと警告を表します。結果の部分は実際の結果と例外のいずれかを表す -`Choice<_,_>` です。 - -`EvalExpression` および `EvalExpressionNonThrowing` の結果部分は -オプションの `FSharpValue` 値です。 -その値が存在しない場合、式が .NET オブジェクトとして表現できる具体的な結果を -持っていなかったということを指し示しています。 -この状況は実際には入力されたどんな通常の式に対しても発生すべきではなく、 -ライブラリ内で使われるプリミティブ値に対してのみ発生すべきです。 -*) - -File.WriteAllText("sample.fsx", "let twenty = 'a' + 10.0") -let result, warnings = fsiSession.EvalScriptNonThrowing "sample.fsx" - -// 結果を表示する -match result with -| Choice1Of2 () -> printfn "チェックと実行はOKでした" -| Choice2Of2 exn -> printfn "実行例外: %s" exn.Message - - -(** -は次のようになります: - - 実行例外: Operation could not be completed due to earlier error -*) - -// エラーと警告を表示する -for w in warnings do - printfn "警告 %s 場所 %d,%d" w.Message w.StartLineAlternate w.StartColumn - -(** -は次のようになります: - - 警告 The type 'float' does not match the type 'char' 場所 1,19 - 警告 The type 'float' does not match the type 'char' 場所 1,17 - -式に対しては: -*) - - -let evalExpressionTyped2<'T> text = - let res, warnings = fsiSession.EvalExpressionNonThrowing(text) - for w in warnings do - printfn "警告 %s 場所 %d,%d" w.Message w.StartLineAlternate w.StartColumn - match res with - | Choice1Of2 (Some value) -> value.ReflectionValue |> unbox<'T> - | Choice1Of2 None -> failwith "null または結果がありません" - | Choice2Of2 (exn:exn) -> failwith (sprintf "例外 %s" exn.Message) - -evalExpressionTyped2 "42+1" // '43' になる - - -(** -並列実行 --------- - -デフォルトでは `EvalExpression` に渡したコードは即時実行されます。 -並列に実行するために、タスクを開始する計算を投入します: -*) - -open System.Threading.Tasks - -let sampleLongRunningExpr = - """ -async { - // 実行したいコード - do System.Threading.Thread.Sleep 5000 - return 10 -} - |> Async.StartAsTask""" - -let task1 = evalExpressionTyped>(sampleLongRunningExpr) -let task2 = evalExpressionTyped>(sampleLongRunningExpr) - -(** -両方の計算がいま開始しました。結果を取得することが出来ます: -*) - - -task1.Result // 完了後に結果が出てくる (最大5秒) -task2.Result // 完了後に結果が出てくる (最大5秒) - -(** -評価コンテキスト内での型チェック --------------------------------- - -F# Interactiveの一連のスクリプティングセッション中で -コードの型チェックを実行したいような状況を考えてみましょう。 -たとえばまず宣言を評価します: -*) - -fsiSession.EvalInteraction "let xxx = 1 + 1" - -(** - -次に部分的に完全な `xxx + xx` というコードの型チェックを実行したいとします: -*) - -let parseResults, checkResults, checkProjectResults = - fsiSession.ParseAndCheckInteraction("xxx + xx") |> Async.RunSynchronously - -(** -`parseResults` と `checkResults` はそれぞれ [エディタ](editor.html) -のページで説明している `ParseFileResults` と `CheckFileResults` 型です。 -たとえば以下のようなコードでエラーを確認出来ます: -*) -checkResults.Errors.Length // 1 - -(** -コードはF# Interactiveセッション内において、その時点までに実行された -有効な宣言からなる論理的な型コンテキストと結びつく形でチェックされます。 - -また、宣言リスト情報やツールチップテキスト、シンボルの解決といった処理を -要求することもできます: - -*) -open FSharp.Compiler - -// ツールチップを取得する -checkResults.GetToolTipText(1, 2, "xxx + xx", ["xxx"], FSharpTokenTag.IDENT) - -checkResults.GetSymbolUseAtLocation(1, 2, "xxx + xx", ["xxx"]) // シンボル xxx - -(** -'fsi'オブジェクト ------------------ - -スクリプトのコードが'fsi'オブジェクトにアクセスできるようにしたい場合、 -このオブジェクトの実装を明示的に渡さなければなりません。 -通常、FSharp.Compiler.Interactive.Settings.dll由来の1つが使われます。 -*) - -let fsiConfig2 = FsiEvaluationSession.GetDefaultConfiguration(fsi) - -(** -収集可能なコード生成 --------------------- - -FsiEvaluationSessionを使用してコードを評価すると、 -.NET の動的アセンブリを生成し、他のリソースを使用します。 -`collectible=true` を渡すことで、生成されたコードを収集可能に出来ます。 -しかしながら、例えば `EvalExpression` から返される `FsiValue` のような型を必要とする未解放のオブジェクト参照が無く、 -かつ `FsiEvaluationSession` を破棄したに違いない場合に限ってコードが収集されます。 -[収集可能なアセンブリに対する制限](https://msdn.microsoft.com/ja-jp/library/dd554932%28v=vs.110%29.aspx#Anchor_1) -も参照してください。 - -以下の例は200個の評価セッションを生成しています。 `collectible=true` と `use session = ...` -の両方を使っていることに気をつけてください。 - -収集可能なコードが正しく動いた場合、全体としてのリソース使用量は -評価が進んでも線形には増加しないでしょう。 -*) - -let collectionTest() = - - for i in 1 .. 200 do - let defaultArgs = [|"fsi.exe";"--noninteractive";"--nologo";"--gui-"|] - use inStream = new StringReader("") - use outStream = new StringWriter() - use errStream = new StringWriter() - - let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() - use session = FsiEvaluationSession.Create(fsiConfig, defaultArgs, inStream, outStream, errStream, collectible=true) - - session.EvalInteraction (sprintf "type D = { v : int }") - let v = session.EvalExpression (sprintf "{ v = 42 * %d }" i) - printfn "その %d, 結果 = %A" i v.Value.ReflectionValue - -// collectionTest() <-- このようにテストを実行する \ No newline at end of file diff --git a/fcs/docsrc/content/ja/project.fsx b/fcs/docsrc/content/ja/project.fsx deleted file mode 100644 index 2cfc847f48..0000000000 --- a/fcs/docsrc/content/ja/project.fsx +++ /dev/null @@ -1,291 +0,0 @@ -(** ---- -category: tutorial -title: プロジェクトの分析 -menu_order: 6 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラサービス: プロジェクトの分析 -====================================== - -このチュートリアルではF#コンパイラによって提供されるサービスを使用して -プロジェクト全体を分析する方法について紹介します。 - -> **注意:** 以下で使用しているAPIは試験的なもので、 - 最新のnugetパッケージの公開に伴って変更されることがあります。 - - -プロジェクト全体の結果を取得する --------------------------------- - -[以前の(型無しASTを使った)チュートリアル](untypedtree.html) と同じく、 -まずは `FSharp.Compiler.Service.dll` への参照追加と、適切な名前空間のオープン、 -`FSharpChecker` インスタンスの作成を行います: - -*) -// F#コンパイラAPIへの参照 -#r "FSharp.Compiler.Service.dll" - -open System -open System.Collections.Generic -open FSharp.Compiler.SourceCodeServices - -// インタラクティブチェッカーのインスタンスを作成 -let checker = FSharpChecker.Create() - -(** -今回のサンプル入力は以下の通りです: -*) - -module Inputs = - open System.IO - - let base1 = Path.GetTempFileName() - let fileName1 = Path.ChangeExtension(base1, ".fs") - let base2 = Path.GetTempFileName() - let fileName2 = Path.ChangeExtension(base2, ".fs") - let dllName = Path.ChangeExtension(base2, ".dll") - let projFileName = Path.ChangeExtension(base2, ".fsproj") - let fileSource1 = """ -module M - -type C() = - member x.P = 1 - -let xxx = 3 + 4 -let fff () = xxx + xxx - """ - File.WriteAllText(fileName1, fileSource1) - - let fileSource2 = """ -module N - -open M - -type D1() = - member x.SomeProperty = M.xxx - -type D2() = - member x.SomeProperty = M.fff() - -// 警告を発生させる -let y2 = match 1 with 1 -> M.xxx - """ - File.WriteAllText(fileName2, fileSource2) - - -(** -`GetProjectOptionsFromCommandLineArgs` を使用して、 -2つのファイルを1つのプロジェクトとして扱えるようにします: -*) - -let projectOptions = - checker.GetProjectOptionsFromCommandLineArgs - (Inputs.projFileName, - [| yield "--simpleresolution" - yield "--noframework" - yield "--debug:full" - yield "--define:DEBUG" - yield "--optimize-" - yield "--out:" + Inputs.dllName - yield "--doc:test.xml" - yield "--warn:3" - yield "--fullpaths" - yield "--flaterrors" - yield "--target:library" - yield Inputs.fileName1 - yield Inputs.fileName2 - let references = - [ @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"] - for r in references do - yield "-r:" + r |]) - -(** -そして(ディスク上に保存されたファイルを使用して) -プロジェクト全体をチェックします: -*) - -let wholeProjectResults = checker.ParseAndCheckProject(projectOptions) |> Async.RunSynchronously - -(** -発生したエラーと警告は以下のようにしてチェックできます: -*) -wholeProjectResults.Errors.Length // 1 -wholeProjectResults.Errors.[0].Message.Contains("Incomplete pattern matches on this expression") // true - -wholeProjectResults.Errors.[0].StartLineAlternate // 13 -wholeProjectResults.Errors.[0].EndLineAlternate // 13 -wholeProjectResults.Errors.[0].StartColumn // 15 -wholeProjectResults.Errors.[0].EndColumn // 16 - -(** -推測されたプロジェクトのシグネチャをチェックします: -*) -[ for x in wholeProjectResults.AssemblySignature.Entities -> x.DisplayName ] // ["N"; "M"] -[ for x in wholeProjectResults.AssemblySignature.Entities.[0].NestedEntities -> x.DisplayName ] // ["D1"; "D2"] -[ for x in wholeProjectResults.AssemblySignature.Entities.[1].NestedEntities -> x.DisplayName ] // ["C"] -[ for x in wholeProjectResults.AssemblySignature.Entities.[0].MembersFunctionsAndValues -> x.DisplayName ] // ["y2"] - -(** -プロジェクト内の全シンボルを取得することもできます: -*) -let rec allSymbolsInEntities (entities: IList) = - [ for e in entities do - yield (e :> FSharpSymbol) - for x in e.MembersFunctionsAndValues do - yield (x :> FSharpSymbol) - for x in e.UnionCases do - yield (x :> FSharpSymbol) - for x in e.FSharpFields do - yield (x :> FSharpSymbol) - yield! allSymbolsInEntities e.NestedEntities ] - -let allSymbols = allSymbolsInEntities wholeProjectResults.AssemblySignature.Entities -(** -プロジェクト全体のチェックが完了した後は、 -プロジェクト内の各ファイルに対する個別の結果を取得することもできます。 -この処理は即座に完了し、改めてチェックが実行されることもありません。 -*) - -let backgroundParseResults1, backgroundTypedParse1 = - checker.GetBackgroundCheckResultsForFileInProject(Inputs.fileName1, projectOptions) - |> Async.RunSynchronously - - -(** -そしてそれぞれのファイル内にあるシンボルを解決できます: -*) - -let xSymbol = - backgroundTypedParse1.GetSymbolUseAtLocation(9,9,"",["xxx"]) - |> Async.RunSynchronously - -(** -それぞれのシンボルに対して、シンボルへの参照を検索することもできます: -*) -let usesOfXSymbol = wholeProjectResults.GetUsesOfSymbol(xSymbol.Value.Symbol) - -(** -推測されたシグネチャ内にあるすべての定義済みシンボルに対して、 -それらがどこで使用されているのかを探し出すこともできます: -*) -let allUsesOfAllSignatureSymbols = - [ for s in allSymbols do - yield s.ToString(), wholeProjectResults.GetUsesOfSymbol(s) ] - -(** -(ローカルスコープで使用されているものも含めて) -プロジェクト全体で使用されているすべてのシンボルを確認することもできます: -*) -let allUsesOfAllSymbols = wholeProjectResults.GetAllUsesOfAllSymbols() - -(** -また、プロジェクト内のファイルに対して、更新後のバージョンに対して -チェックを実行するようにリクエストすることもできます -(なお [FileSystem API](filesystem.html) を使用していない場合には、 -プロジェクト内のその他のファイルがまだディスクから -読み取り中であることに注意してください): - -*) -let parseResults1, checkAnswer1 = - checker.ParseAndCheckFileInProject(Inputs.fileName1, 0, Inputs.fileSource1, projectOptions) - |> Async.RunSynchronously - -let checkResults1 = - match checkAnswer1 with - | FSharpCheckFileAnswer.Succeeded x -> x - | _ -> failwith "想定外の終了状態です" - -let parseResults2, checkAnswer2 = - checker.ParseAndCheckFileInProject(Inputs.fileName2, 0, Inputs.fileSource2, projectOptions) - |> Async.RunSynchronously - -let checkResults2 = - match checkAnswer2 with - | FSharpCheckFileAnswer.Succeeded x -> x - | _ -> failwith "想定外の終了状態です" - -(** -そして再びシンボルを解決したり、参照を検索したりすることができます: -*) - -let xSymbol2 = - checkResults1.GetSymbolUseAtLocation(9,9,"",["xxx"]) - |> Async.RunSynchronously - -let usesOfXSymbol2 = wholeProjectResults.GetUsesOfSymbol(xSymbol2.Value.Symbol) - -(** -あるいは(ローカルスコープで使用されているシンボルも含めて) -ファイル中で使用されているすべてのシンボルを検索することもできます: -*) -let allUsesOfAllSymbolsInFile1 = checkResults1.GetAllUsesOfAllSymbolsInFile() - -(** -あるいは特定のファイル中で使用されているシンボルを検索することもできます: -*) -let allUsesOfXSymbolInFile1 = checkResults1.GetUsesOfSymbolInFile(xSymbol2.Value.Symbol) - -let allUsesOfXSymbolInFile2 = checkResults2.GetUsesOfSymbolInFile(xSymbol2.Value.Symbol) - -(** - -複数プロジェクトの分析 ----------------------- - -複数のプロジェクトにまたがった参照があるような、 -複数のF# プロジェクトを分析したい場合、 -それらのプロジェクトを一旦ビルドして、 -ProjectOptionsで `-r:プロジェクト-出力-までの-パス.dll` 引数を指定して -プロジェクトの相互参照を設定すると一番簡単です。 -しかしこの場合、それぞれのプロジェクトが正しくビルド出来、 -DLLファイルが参照可能なディスク上に生成されなければいけません。 - -たとえばIDEを操作している場合など、状況によっては -DLLのコンパイルが通るようになる前に -プロジェクトを参照したいことがあるでしょう。 -この場合はProjectOptionsのReferencedProjectsを設定します。 -この値には依存するプロジェクトのオプションを再帰的に指定します。 -それぞれのプロジェクト参照にはやはり、 -ReferencedProjectsのエントリそれぞれに対応する -`-r:プロジェクト-出力-までの-パス.dll` というコマンドライン引数を -ProjectOptionsに設定する必要があります。 - -プロジェクト参照が設定されると、ソースファイルからのF#プロジェクト分析処理が -インクリメンタル分析の結果を使用して行われるようになります。 -その際にはソースファイルファイルをDLLへとコンパイルする必要はありません。 - -相互参照を含むようなF#プロジェクトを効率よく分析するには、 -ReferencedProjectsを正しく設定した後、 -それぞれのプロジェクトを順番通りに分析していくとよいでしょう。 - -> **注意:** プロジェクトの参照機能は試作段階です。 - プロジェクトの参照を使用すると、依存先のプロジェクトがまだ分析中で、 - 要求したサービスがまだ利用できないことがあるため、 - コンパイラサービスの性能が低下することがあります。 - -> **注意:** アセンブリが型プロバイダーのコンポーネントを含む場合、 - プロジェクト参照機能は利用できません。 - プロジェクトの分析処理を強制しない限りはプロジェクト参照を設定しても - 効果がありません。 - また、分析を強制する場合にはディスク上にDLLが存在しなければいけません。 - -*) - -(** -まとめ ------- - -これまで説明してきた通り、 `ParseAndCheckProject` を使用すると -シンボルの参照などのようなプロジェクト全体の解析結果にアクセスできるようになります。 -シンボルに対する処理の詳細については [シンボル](symbols.html) のページを参照してください。 - -*) diff --git a/fcs/docsrc/content/ja/symbols.fsx b/fcs/docsrc/content/ja/symbols.fsx deleted file mode 100644 index 84bac9e137..0000000000 --- a/fcs/docsrc/content/ja/symbols.fsx +++ /dev/null @@ -1,245 +0,0 @@ -(** ---- -category: tutorial -title: シンボルの処理 -menu_order: 4 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラサービス: シンボルの処理 -================================== - -このチュートリアルでは、F#コンパイラによって提供される -シンボルの扱い方についてのデモを紹介します。 -シンボルの参照に関する情報については [プロジェクト全体の分析](project.html) -も参考にしてください。 - -> **注意:** 以下で使用しているAPIは試験的なもので、 - 最新のnugetパッケージの公開に伴って変更されることがあります。 - -これまでと同じく、 `FSharp.Compiler.Service.dll` への参照を追加した後、 -適切な名前空間をオープンし、 `FSharpChecker` のインスタンスを作成します: - -*) -// F#コンパイラAPIへの参照 -#r "FSharp.Compiler.Service.dll" - -open System -open System.IO -open FSharp.Compiler.SourceCodeServices - -// インタラクティブチェッカーのインスタンスを作成 -let checker = FSharpChecker.Create() - -(** - -そして特定の入力値に対して型チェックを行います: - -*) - -let parseAndTypeCheckSingleFile (file, input) = - // スタンドアロンの(スクリプト)ファイルを表すコンテキストを取得 - let projOptions, _errors = - checker.GetProjectOptionsFromScript(file, input) - |> Async.RunSynchronously - - let parseFileResults, checkFileResults = - checker.ParseAndCheckFileInProject(file, 0, input, projOptions) - |> Async.RunSynchronously - - // 型チェックが成功(あるいは100%に到達)するまで待機 - match checkFileResults with - | FSharpCheckFileAnswer.Succeeded(res) -> parseFileResults, res - | res -> failwithf "Parsing did not finish... (%A)" res - -let file = "/home/user/Test.fsx" - -(** -## ファイルに対する解決済みのシグネチャ情報を取得する - -ファイルに対する型チェックが完了すると、 -`TypeCheckResults` の `PartialAssemblySignature` プロパティを参照することにより、 -チェック中の特定のファイルを含む、推論されたプロジェクトのシグネチャに -アクセスすることができます。 - -モジュールや型、属性、メンバ、値、関数、共用体、レコード型、測定単位、 -およびその他のF#言語要素に対する完全なシグネチャ情報が参照できます。 - -ただし型付き式ツリーに対する情報は(今のところ)この方法では利用できません。 - -*) - -let input2 = - """ -[] -let foo(x, y) = - let msg = String.Concat("Hello"," ","world") - if true then - printfn "x = %d, y = %d" x y - printfn "%s" msg - -type C() = - member x.P = 1 - """ -let parseFileResults, checkFileResults = - parseAndTypeCheckSingleFile(file, input2) - -(** -これでコードに対する部分的なアセンブリのシグネチャが取得できるようになります: -*) -let partialAssemblySignature = checkFileResults.PartialAssemblySignature - -partialAssemblySignature.Entities.Count = 1 // エンティティは1つ - -(** -そしてコードを含むモジュールに関連したエンティティを取得します: -*) -let moduleEntity = partialAssemblySignature.Entities.[0] - -moduleEntity.DisplayName = "Test" - -(** -そしてコード内の型定義に関連したエンティティを取得します: -*) -let classEntity = moduleEntity.NestedEntities.[0] - -(** -そしてコード内で定義された関数に関連した値を取得します: -*) -let fnVal = moduleEntity.MembersFunctionsAndValues.[0] - -(** -関数値に関するプロパティの値を確認してみましょう。 -*) -fnVal.Attributes.Count // 1 -fnVal.CurriedParameterGroups.Count // 1 -fnVal.CurriedParameterGroups.[0].Count // 2 -fnVal.CurriedParameterGroups.[0].[0].Name // "x" -fnVal.CurriedParameterGroups.[0].[1].Name // "y" -fnVal.DeclarationLocation.StartLine // 3 -fnVal.DisplayName // "foo" -fnVal.DeclaringEntity.Value.DisplayName // "Test" -fnVal.DeclaringEntity.Value.DeclarationLocation.StartLine // 1 -fnVal.GenericParameters.Count // 0 -fnVal.InlineAnnotation // FSharpInlineAnnotation.OptionalInline -fnVal.IsActivePattern // false -fnVal.IsCompilerGenerated // false -fnVal.IsDispatchSlot // false -fnVal.IsExtensionMember // false -fnVal.IsPropertyGetterMethod // false -fnVal.IsImplicitConstructor // false -fnVal.IsInstanceMember // false -fnVal.IsMember // false -fnVal.IsModuleValueOrMember // true -fnVal.IsMutable // false -fnVal.IsPropertySetterMethod // false -fnVal.IsTypeFunction // false - -(** -次に、この関数の型がファーストクラスの値として使用されているかどうかチェックします。 -(ちなみに `CurriedParameterGroups` プロパティには引数の名前など、 -より多くの情報も含まれています) -*) -fnVal.FullType // int * int -> unit -fnVal.FullType.IsFunctionType // true -fnVal.FullType.GenericArguments.[0] // int * int -fnVal.FullType.GenericArguments.[0].IsTupleType // true -let argTy1 = fnVal.FullType.GenericArguments.[0].GenericArguments.[0] - -argTy1.TypeDefinition.DisplayName // int - -(** -というわけで `int * int -> unit` という型を表現するオブジェクトが取得できて、 -その1つめの 'int' を確認できたわけです。 -また、以下のようにすると 'int' 型についてのより詳細な情報が取得でき、 -それが名前付きの型であり、F#の型省略形 `type int = int32` であることがわかります: -*) - -argTy1.HasTypeDefinition // true -argTy1.TypeDefinition.IsFSharpAbbreviation // true - -(** -型省略形の右辺、つまり `int32` についてもチェックしてみましょう: -*) - -let argTy1b = argTy1.TypeDefinition.AbbreviatedType -argTy1b.TypeDefinition.Namespace // Some "Microsoft.FSharp.Core" -argTy1b.TypeDefinition.CompiledName // "int32" - -(** -そして再び型省略形 `type int32 = System.Int32` から型に関する完全な情報が取得できます: -*) -let argTy1c = argTy1b.TypeDefinition.AbbreviatedType -argTy1c.TypeDefinition.Namespace // Some "System" -argTy1c.TypeDefinition.CompiledName // "Int32" - -(** -ファイルに対する型チェックの結果には、 -コンパイル時に使用されたプロジェクト(あるいはスクリプト)のオプションに関する -`ProjectContext` と呼ばれる情報も含まれています: -*) -let projectContext = checkFileResults.ProjectContext - -for assembly in projectContext.GetReferencedAssemblies() do - match assembly.FileName with - | None -> printfn "コンパイル時にファイルの存在しないアセンブリを参照しました" - | Some s -> printfn "コンパイル時にアセンブリ '%s' を参照しました" s - -(** -**注意:** - - - 不完全なコードが存在する場合、一部あるいはすべての属性が意図したとおりには - 並ばないことがあります。 - - (実際には非常によくあることですが)一部のアセンブリが見つからない場合、 - 外部アセンブリに関連する値やメンバ、エンティティにおける 'IsUnresolved' が - trueになることがあります。 - IsUnresolvedによる例外に対処できるよう、堅牢なコードにしておくべきです。 - -*) - -(** - -## プロジェクト全体に対するシンボル情報を取得する - -プロジェクト全体をチェックする場合、チェッカーを作成した後に `parseAndCheckScript` -を呼び出します。 -今回の場合は単に1つのスクリプトだけが含まれたプロジェクトをチェックします。 -異なる "projOptions" を指定すると、巨大なプロジェクトに対する設定を -構成することもできます。 -*) -let parseAndCheckScript (file, input) = - let projOptions, errors = - checker.GetProjectOptionsFromScript(file, input) - |> Async.RunSynchronously - - let projResults = - checker.ParseAndCheckProject(projOptions) - |> Async.RunSynchronously - - projResults - -(** -そして特定の入力に対してこの関数を呼び出します: -*) - -let tmpFile = Path.ChangeExtension(System.IO.Path.GetTempFileName() , "fs") -File.WriteAllText(tmpFile, input2) - -let projectResults = parseAndCheckScript(tmpFile, input2) - - -(** -結果は以下の通りです: -*) - -let assemblySig = projectResults.AssemblySignature - -assemblySig.Entities.Count = 1 // エンティティは1つ -assemblySig.Entities.[0].Namespace // null -assemblySig.Entities.[0].DisplayName // "Tmp28D0" -assemblySig.Entities.[0].MembersFunctionsAndValues.Count // 1 -assemblySig.Entities.[0].MembersFunctionsAndValues.[0].DisplayName // "foo" diff --git a/fcs/docsrc/content/ja/tokenizer.fsx b/fcs/docsrc/content/ja/tokenizer.fsx deleted file mode 100644 index 6731501088..0000000000 --- a/fcs/docsrc/content/ja/tokenizer.fsx +++ /dev/null @@ -1,154 +0,0 @@ -(** ---- -category: tutorial -title: F#トークナイザを使用する -menu_order: 1 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラサービス:F#トークナイザを使用する -============================================ - -このチュートリアルではF#言語トークナイザの呼び出し方を紹介します。 -F#のソースコードに対して、トークナイザは -コードの各行にあるトークンに関する情報を含んだソースコード行のリストを生成します。 -各トークンに対してはトークンの種類や位置を取得したり、 -トークンの種類(キーワード、識別子、数値、演算子など)に応じた -色を取得したりすることができます。 - -> **注意:** 以下で使用しているAPIは実験的なもので、 - 新しいnugetパッケージの公開に伴って変更される可能性があります。 - -トークナイザの作成 ------------------- - -トークナイザを使用するには、 `FSharp.Compiler.Service.dll` への参照を追加した後に -`SourceCodeServices` 名前空間をオープンします: -*) -#r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.SourceCodeServices -(** -すると `FSharpSourceTokenizer` のインスタンスを作成できるようになります。 -このクラスには2つの引数を指定します。 -最初の引数には定義済みのシンボルのリスト、 -2番目の引数にはソースコードのファイル名を指定します。 -定義済みのシンボルのリストを指定するのは、 -トークナイザが `#if` ディレクティブを処理する必要があるからです。 -ファイル名はソースコードの位置を特定する場合にのみ指定する必要があります -(存在しないファイル名でも指定できます): -*) -let sourceTok = FSharpSourceTokenizer([], "C:\\test.fsx") -(** -`sourceTok` オブジェクトを使用することでF#ソースコードの各行を -(繰り返し)トークン化することができます。 - -F#コードのトークン化 --------------------- - -トークナイザはソースファイル全体ではなく、行単位で処理を行います。 -トークンを取得した後、トークナイザは新しいステートを( `int64` 値として)返します。 -この値を使うとF#コードをより効率的にトークン化できます。 -つまり、ソースコードが変更された場合もファイル全体を -再度トークン化する必要はありません。 -変更された部分だけをトークン化すればよいのです。 - -### 1行をトークン化する - -1行をトークン化するには、先ほど作成した `FSharpSourceTokenizer` オブジェクトに対して -`CreateLineTokenizer` を呼び、 `FSharpLineTokenizer` を作成します: -*) -let tokenizer = sourceTok.CreateLineTokenizer("let answer=42") -(** -そして `tokenizer` の `ScanToken` を繰り返し `None` を返すまで -(つまり最終行に到達するまで)繰り返し呼び出すような単純な再帰関数を用意します。 -この関数が成功すると、必要な詳細情報をすべて含んだ `FSharpTokenInfo` オブジェクトが -返されます: -*) -/// F#コード1行をトークン化します -let rec tokenizeLine (tokenizer:FSharpLineTokenizer) state = - match tokenizer.ScanToken(state) with - | Some tok, state -> - // トークン名を表示 - printf "%s " tok.TokenName - // 新しい状態で残りをトークン化 - tokenizeLine tokenizer state - | None, state -> state -(** -この関数は、複数行コードや複数行コメント内の前方の行をトークン化する場合に -必要となるような新しい状態を返します。 -初期値としては `0L` を指定します: -*) -tokenizeLine tokenizer FSharpTokenizerLexState.Initial -(** -この結果は LET WHITESPACE IDENT EQUALS INT32 という -トークン名のシーケンスになります。 -`FSharpTokenInfo` にはたとえば以下のような興味深いプロパティが多数あります: - - - `CharClass` および `ColorClass` はF#コードを色づけする場合に使用できるような、 - トークンのカテゴリに関する情報を返します。 - - `LeftColumn` および `RightColumn` は行内におけるトークンの位置を返します。 - - `TokenName` は(F# レキサ内で定義された)トークンの名前を返します。 - -なおトークナイザはステートフルであることに注意してください。 -つまり、1行を複数回トークン化したい場合にはその都度 `CreateLineTokenizer` を -呼び出す必要があります。 - -### サンプルコードのトークン化 - -トークナイザをもっと長いサンプルコードやファイル全体に対して実行する場合、 -サンプル入力を `string` のコレクションとして読み取る必要があります: -*) -let lines = """ - // Hello world - let hello() = - printfn "Hello world!" """.Split('\r','\n') -(** -複数行の入力値をトークン化する場合も、現在の状態を保持するような -再帰関数が必要になります。 -以下の関数はソースコード行を文字列のリストとして受け取ります -(また、行番号および現在の状態も受け取ります)。 -各行に対して新しいトークナイザを作成して、 -直前の行における **最後** の状態を使って `tokenizeLine` を呼び出します: -*) -/// 複数行のコードに対してトークンの名前を表示します -let rec tokenizeLines state count lines = - match lines with - | line::lines -> - // トークナイザを作成して1行をトークン化 - printfn "\nLine %d" count - let tokenizer = sourceTok.CreateLineTokenizer(line) - let state = tokenizeLine tokenizer state - // 新しい状態を使って残りをトークン化 - tokenizeLines state (count+1) lines - | [] -> () -(** -ここでは単に(先ほど定義した) `tokenizeLine` を呼び出して、 -各行にあるすべてのトークンの名前を表示しています。 -この関数は先と同じく、初期状態の値 `0L` と、1行目を表す `1` を -指定して呼び出すことができます: -*) -lines -|> List.ofSeq -|> tokenizeLines FSharpTokenizerLexState.Initial 1 -(** -重要ではない部分(各行の先頭にある空白文字や、1行目のように空白文字しかない行) -を除けば、このコードを実行すると以下のような出力になります: - - [lang=text] - Line 1 - LINE_COMMENT LINE_COMMENT (...) LINE_COMMENT - Line 2 - LET WHITESPACE IDENT LPAREN RPAREN WHITESPACE EQUALS - Line 3 - IDENT WHITESPACE STRING_TEXT (...) STRING_TEXT STRING - -注目すべきは、単一行コメントや文字列に対して、 -トークナイザが複数回(大まかにいって単語単位で) `LINE_COMMENT` や -`STRING_TEXT` を返しているところです。 -したがって、コメントや文字列全体をテキストとして取得したい場合には -それぞれのトークンを連結する必要があります。 -*) \ No newline at end of file diff --git a/fcs/docsrc/content/ja/untypedtree.fsx b/fcs/docsrc/content/ja/untypedtree.fsx deleted file mode 100644 index a558bf132a..0000000000 --- a/fcs/docsrc/content/ja/untypedtree.fsx +++ /dev/null @@ -1,285 +0,0 @@ -(** ---- -category: tutorial -title: 型無し構文木の処理 -menu_order: 2 -language: ja - ---- -*) -(*** hide ***) -#I "../../../../artifacts/bin/fcs/Release/net461" -(** -コンパイラサービス:型無し構文木の処理 -====================================== - -このチュートリアルではF#コードに対する型無し抽象構文木 -(untyped abstract syntax tree: untyped AST) -を取得する方法、および木全体を走査する方法を紹介します。 -この処理を行うことによって、コードフォーマットツールや -基本的なリファクタリングツール、コードナビゲーションツールなどを作成できます。 -型無し構文木にはコードの構造に関する情報が含まれていますが、 -型情報が含まれていないだけでなく、後で型チェッカーを通すまでは -解決されないような曖昧さも残されています。 -また、 [エディタサービス](editor.html) として提供されているAPIと -型無しASTの情報を組み合わせることもできます。 - -> **注釈:** 以下で使用しているAPIは試験的なもので、将来的に変更される場合があります。 - つまりFSharp.Compiler.Service.dll には既存のものと重複する機能が多数あるため、 - 将来的にはもっときちんとした形に変更されます。 - そのため、これらのサービスを使用するAPIには破壊的変更が加えられる可能性があります。 - - -型無しASTの取得 ---------------- - - -型無しASTにアクセスするには、 `FSharpChecker` のインスタンスを作成します。 -これは型チェックおよびパース用のコンテキストを表す型で、、 -スタンドアロンのF#スクリプトファイル(たとえばVisual Studioで開いたファイル)、 -あるいは複数ファイルで構成されたロード済みのプロジェクトファイルの -いずれかと結びつきます。 -このインスタンスを作成すると、型チェックの最初のステップである -「型無しパース」を実行できます。 -次のフェーズは「型有りパース」で、これは [エディタサービス](editor.html) で -使用されるものです。 - -インタラクティブチェッカーを使用するには、 -`FSharp.Compiler.Service.dll` への参照を追加した後、 -`SourceCodeServices` 名前空間をオープンします: -*) -#r "FSharp.Compiler.Service.dll" -open System -open FSharp.Compiler.SourceCodeServices -(** - -### 型無しパースの実行 - -型無しパース処理は(それなりの時間がかかる型チェック処理と比較すると) -かなり高速なため、同期的に実行できます。 -まず `FSharpChecker` を作成します。 - -*) -// インタラクティブチェッカーのインスタンスを作成 -let checker = FSharpChecker.Create() -(** - -ASTを取得するために、ファイル名とソースコードを受け取る関数を用意します -(ファイル名は位置情報のためだけに使用されるもので、存在しなくても構いません)。 -まず、コンテキストを表す「インタラクティブチェッカーオプション」を -用意する必要があります。 -単純な処理に対しては、 `GetCheckOptionsFromScriptRoot` を使えば -スクリプトファイルのコンテキストを推測させることができます。 -そして `UntypedParse` メソッドを呼び出した後、 -`ParseTree` プロパティの値を返します: - -*) -/// 特定の入力に対する型無し構文木を取得する -let getUntypedTree (file, input) = - // 1つのスクリプトファイルから推測される「プロジェクト」用の - // コンパイラオプションを取得する - let projOptions, errors = - checker.GetProjectOptionsFromScript(file, input) - |> Async.RunSynchronously - - let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projectOptions) - - // コンパイラの第1フェーズを実行する - let untypedRes = - checker.ParseFile(file, input, parsingOptions) - |> Async.RunSynchronously - - match untypedRes.ParseTree with - | Some tree -> tree - | None -> failwith "パース中に何らかの問題が発生しました!" - -(** -`FSharpChecker` の詳細については -[ APIドキュメント](../reference/microsoft-fsharp-compiler-sourcecodeservices-FSharpChecker.html) -の他に、F# ソースコードのインラインコメントも参考になるでしょう -( [`service.fsi` のソースコードを参照](https://github.com/fsharp/fsharp/blob/fsharp_31/src/fsharp/service/service.fsi) )。 - -ASTの走査 ---------- - -抽象構文木は(式やパターン、宣言など)それぞれ異なる文法的要素を表現する、 -多数の判別共用体として定義されています。 -ASTを理解するには -[`ast.fs`内にあるソースコード](https://github.com/fsharp/fsharp/blob/master/src/fsharp/ast.fs#L464) -の定義を確認する方法が一番よいでしょう。 - -ASTに関連する要素は以下の名前空間に含まれています: -*) -open FSharp.Compiler.Ast -(** - -ASTを処理する場合、異なる文法的要素に対するパターンマッチを行うような -相互再帰関数を多数用意することになります。 -サポートすべき要素は非常に多種多様です。 -たとえばトップレベル要素としてはモジュールや名前空間の宣言、 -モジュール内における(letバインディングや型などの)宣言などがあります。 -モジュール内のlet宣言には式が含まれ、さらにこの式に -パターンが含まれていることもあります。 - -### パターンと式を走査する - -まずは式とパターンを走査する関数から始めます。 -この関数は要素を走査しつつ、要素に関する情報を画面に表示します。 -パターンの場合、入力は `SynPat` 型であり、この型には `Wild` ( `_` パターンを表す)や -`Named` ( ` という名前` のパターン)、 -`LongIdent` ( `Foo.Bar` 形式の名前)など、多数のケースがあります。 -なお、基本的にパース後のパターンは元のソースコードの見た目よりも複雑になります -(具体的には `Named` がかなり多数現れます): -*) -/// パターンの走査 -/// これは let = あるいは 'match' 式に対する例です -let rec visitPattern = function - | SynPat.Wild(_) -> - printfn " .. アンダースコアパターン" - | SynPat.Named(pat, name, _, _, _) -> - visitPattern pat - printfn " .. 名前 '%s' のパターン" name.idText - | SynPat.LongIdent(LongIdentWithDots(ident, _), _, _, _, _, _) -> - let names = String.concat "." [ for i in ident -> i.idText ] - printfn " .. 識別子: %s" names - | pat -> printfn " .. その他のパターン: %A" pat -(** -この関数は (`bar という名前の (foo, _)` のような、 -ネストされたパターンに対応するために) 再帰関数になっていますが、 -以降で定義するいずれの関数も呼び出しません -(パターンはその他の文法的な要素を含むことができないからです)。 - -次の関数は式全体を走査するものです。 -これは処理の大部分が行われる関数で、 -20以上のケースをカバーすることになるでしょう -( `SynExpr` と入力するとその他のオプションが確認できます)。 -以下のコードでは `if .. then ..` と `let .. = ...` という式を -処理する方法だけを紹介しています: -*) -/// 式を走査する。 -/// 式に2つあるいは3つの部分式が含まれていた場合('else'の分岐がない場合は2つ)、 -/// let式にはパターンおよび2つの部分式が含まれる -let rec visitExpression = function - | SynExpr.IfThenElse(cond, trueBranch, falseBranchOpt, _, _, _, _) -> - // すべての部分式を走査 - printfn "条件部:" - visitExpression cond - visitExpression trueBranch - falseBranchOpt |> Option.iter visitExpression - - | SynExpr.LetOrUse(_, _, bindings, body, _) -> - // バインディングを走査 - // ('let .. = .. and .. = .. in ...' に対しては複数回走査されることがある) - printfn "以下のバインディングを含むLetOrUse:" - for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, init, m, sp)) = binding - visitPattern pat - visitExpression init - // 本体の式を走査 - printfn "本体は以下:" - visitExpression body - | expr -> printfn " - サポート対象外の式: %A" expr -(** -`visitExpression` 関数はモジュール内のすべてのトップレベル宣言を走査するような -関数から呼ばれることになります。 -今回のチュートリアルでは型やメンバーを無視していますが、 -これらを走査する場合も `visitExpression` を呼び出すことになるでしょう。 - -### 宣言を走査する - -既に説明したように、1つのファイルに対するASTには多数のモジュールや -名前空間の宣言が(トップレベルノードとして)含まれ、 -モジュール内にも(letバインディングや型の)宣言が、 -名前空間にも(こちらは単に型だけの)宣言が含まれます。 -以下の関数はそれぞれの宣言を走査します。 -ただし今回は型やネストされたモジュール、その他の要素については無視して、 -トップレベルの(値および関数に対する) `let` バインディングだけを対象にしています: -*) -/// モジュール内の宣言リストを走査する。 -/// モジュール内のトップレベルに記述できるすべての要素 -/// (letバインディングやネストされたモジュール、型の宣言など)が対象になる。 -let visitDeclarations decls = - for declaration in decls do - match declaration with - | SynModuleDecl.Let(isRec, bindings, range) -> - // 宣言としてのletバインディングは - // (visitExpressionで処理したような)式としてのletバインディングと - // 似ているが、本体を持たない - for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, body, m, sp)) = binding - visitPattern pat - visitExpression body - | _ -> printfn " - サポート対象外の宣言: %A" declaration -(** -`visitDeclarations` 関数はモジュールや名前空間の宣言のシーケンスを走査する -関数から呼ばれることになります。 -このシーケンスはたとえば複数の `namespace Foo` 宣言を含むようなファイルに対応します: -*) -/// すべてのモジュールや名前空間の宣言を走査する -/// (基本的には 'module Foo =' または 'namespace Foo.Bar' というコード) -/// なおファイル中で明示的に定義されていない場合であっても -/// 暗黙的にモジュールまたは名前空間の宣言が存在することに注意。 -let visitModulesAndNamespaces modulesOrNss = - for moduleOrNs in modulesOrNss do - let (SynModuleOrNamespace(lid, isRec, isMod, decls, xml, attrs, _, m)) = moduleOrNs - printfn "名前空間またはモジュール: %A" lid - visitDeclarations decls -(** -以上でASTの要素を(宣言から始まって式やパターンに至るまで)走査するための -関数がそろったので、サンプル入力からASTを取得した後、 -上記の関数を実行することができるようになりました。 - -すべてを組み合わせる --------------------- - -既に説明したように、 `getUntypedTree` 関数では `FSharpChecker` を使って -ASTに対する第1フェーズ(パース)を行ってツリーを返しています。 -この関数にはF#のソースコードとともに、ファイルのパスを指定する必要があります。 -(単に位置情報として利用されるだけなので) -指定先のパスにファイルが存在している必要はなく、 -UnixとWindowsどちらの形式でも指定できます: -*) -// コンパイラサービスへのサンプル入力 -let input = """ - let foo() = - let msg = "Hello world" - if true then - printfn "%s" msg """ -// Unix形式のファイル名 -let file = "/home/user/Test.fsx" - -// サンプルF#コードに対するASTを取得 -let tree = getUntypedTree(file, input) -(** -このコードをF# Interactiveで実行した場合、コンソールに `tree;;` と入力すると、 -データ構造に対する文字列表現が表示されることが確認できます。 -ツリーには大量の情報が含まれているため、あまり読みやすいものではありませんが、 -木が動作する様子を想像することはできるでしょう。 - -`tree` の返値はやはり判別共用体で、2つのケースに分かれます。 -1つはF#のシグネチャファイル( `*.fsi` )を表す `ParsedInput.SigFile` で、 -もう1つは通常のソースコード( `*.fsx` または `*.fs` )を表す -`ParsedInput.ImplFile` です。 -上記の手順で作成した関数に渡すことができるモジュールや名前空間のシーケンスは -実装ファイルに含まれています: -*) -// 実装ファイルの詳細をチェックする -match tree with -| ParsedInput.ImplFile(implFile) -> - // 宣言を展開してそれぞれを走査する - let (ParsedImplFileInput(fn, script, name, _, _, modules, _)) = implFile - visitModulesAndNamespaces modules -| _ -> failwith "F# インターフェイスファイル (*.fsi) は未サポートです。" -(** -まとめ ------- -このチュートリアルでは型無し抽象構文木に対する基本的な走査方法を紹介しました。 -このトピックは包括的なものであるため、1つの記事ですべてを説明することは不可能です。 -さらに深く理解するためには、型無しASTを活用するツールのよい例として -[Fantomas project](https://github.com/dungpa/fantomas) を参考にするとよいでしょう。 -実際には今回参照したような情報と、次のチュートリアルで説明する -[エディタサービス](editor.html) から得られる情報とを -組み合わせて利用することになるでしょう。 -*) diff --git a/fcs/docsrc/content/project.fsx b/fcs/docsrc/content/project.fsx deleted file mode 100644 index ee0750561d..0000000000 --- a/fcs/docsrc/content/project.fsx +++ /dev/null @@ -1,326 +0,0 @@ -(** ---- -category: tutorial -title: Project Analysis -menu_order: 6 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Project Analysis -================================== - -This tutorial demonstrates how to can analyze a whole project using services provided by the F# compiler. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published. - -*) - - -(** - -Getting whole-project results ------------------------------ - -As in the [previous tutorial (using untyped AST)](untypedtree.html), we start by referencing -`FSharp.Compiler.Service.dll`, opening the relevant namespace and creating an instance -of `InteractiveChecker`: - -*) -// Reference F# compiler API -#r "FSharp.Compiler.Service.dll" - -open System -open System.Collections.Generic -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Text - -// Create an interactive checker instance -let checker = FSharpChecker.Create() - -(** -Here are our sample inputs: -*) - -module Inputs = - open System.IO - - let base1 = Path.GetTempFileName() - let fileName1 = Path.ChangeExtension(base1, ".fs") - let base2 = Path.GetTempFileName() - let fileName2 = Path.ChangeExtension(base2, ".fs") - let dllName = Path.ChangeExtension(base2, ".dll") - let projFileName = Path.ChangeExtension(base2, ".fsproj") - let fileSource1 = """ -module M - -type C() = - member x.P = 1 - -let xxx = 3 + 4 -let fff () = xxx + xxx - """ - File.WriteAllText(fileName1, fileSource1) - - let fileSource2 = """ -module N - -open M - -type D1() = - member x.SomeProperty = M.xxx - -type D2() = - member x.SomeProperty = M.fff() + D1().P - -// Generate a warning -let y2 = match 1 with 1 -> M.xxx - """ - File.WriteAllText(fileName2, fileSource2) - - -(** -We use `GetProjectOptionsFromCommandLineArgs` to treat two files as a project: -*) - -let projectOptions = - let sysLib nm = - if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then - // file references only valid on Windows - System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + - @"\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\" + nm + ".dll" - else - let sysDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() - let (++) a b = System.IO.Path.Combine(a,b) - sysDir ++ nm + ".dll" - - let fsCore4300() = - if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then - // file references only valid on Windows - System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + - @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll" - else - sysLib "FSharp.Core" - - checker.GetProjectOptionsFromCommandLineArgs - (Inputs.projFileName, - [| yield "--simpleresolution" - yield "--noframework" - yield "--debug:full" - yield "--define:DEBUG" - yield "--optimize-" - yield "--out:" + Inputs.dllName - yield "--doc:test.xml" - yield "--warn:3" - yield "--fullpaths" - yield "--flaterrors" - yield "--target:library" - yield Inputs.fileName1 - yield Inputs.fileName2 - let references = - [ sysLib "mscorlib" - sysLib "System" - sysLib "System.Core" - fsCore4300() ] - for r in references do - yield "-r:" + r |]) - -(** -Now check the entire project (using the files saved on disk): -*) - -let wholeProjectResults = checker.ParseAndCheckProject(projectOptions) |> Async.RunSynchronously - -(** -Now look at the errors and warnings: -*) -wholeProjectResults .Errors.Length // 1 -wholeProjectResults.Errors.[0].Message.Contains("Incomplete pattern matches on this expression") // yes it does - -wholeProjectResults.Errors.[0].StartLineAlternate // 13 -wholeProjectResults.Errors.[0].EndLineAlternate // 13 -wholeProjectResults.Errors.[0].StartColumn // 15 -wholeProjectResults.Errors.[0].EndColumn // 16 - -(** -Now look at the inferred signature for the project: -*) -[ for x in wholeProjectResults.AssemblySignature.Entities -> x.DisplayName ] // ["N"; "M"] -[ for x in wholeProjectResults.AssemblySignature.Entities.[0].NestedEntities -> x.DisplayName ] // ["D1"; "D2"] -[ for x in wholeProjectResults.AssemblySignature.Entities.[1].NestedEntities -> x.DisplayName ] // ["C"] -[ for x in wholeProjectResults.AssemblySignature.Entities.[0].MembersFunctionsAndValues -> x.DisplayName ] // ["y"; "y2"] - -(** -You can also get all symbols in the project: -*) -let rec allSymbolsInEntities (entities: IList) = - [ for e in entities do - yield (e :> FSharpSymbol) - for x in e.MembersFunctionsAndValues do - yield (x :> FSharpSymbol) - for x in e.UnionCases do - yield (x :> FSharpSymbol) - for x in e.FSharpFields do - yield (x :> FSharpSymbol) - yield! allSymbolsInEntities e.NestedEntities ] - -let allSymbols = allSymbolsInEntities wholeProjectResults.AssemblySignature.Entities -(** -After checking the whole project, you can access the background results for individual files -in the project. This will be fast and will not involve any additional checking. -*) - -let backgroundParseResults1, backgroundTypedParse1 = - checker.GetBackgroundCheckResultsForFileInProject(Inputs.fileName1, projectOptions) - |> Async.RunSynchronously - - -(** -You can now resolve symbols in each file: -*) - -let xSymbolUseOpt = - backgroundTypedParse1.GetSymbolUseAtLocation(9,9,"",["xxx"]) - |> Async.RunSynchronously - -let xSymbolUse = xSymbolUseOpt.Value - -let xSymbol = xSymbolUse.Symbol - -(** -You can find out more about a symbol by doing type checks on various symbol kinds: -*) - -let xSymbolAsValue = - match xSymbol with - | :? FSharpMemberOrFunctionOrValue as xSymbolAsVal -> xSymbolAsVal - | _ -> failwith "we expected this to be a member, function or value" - - -(** -For each symbol, you can look up the references to that symbol: -*) -let usesOfXSymbol = - wholeProjectResults.GetUsesOfSymbol(xSymbol) - |> Async.RunSynchronously - -(** -You can iterate all the defined symbols in the inferred signature and find where they are used: -*) -let allUsesOfAllSignatureSymbols = - [ for s in allSymbols do - let uses = wholeProjectResults.GetUsesOfSymbol(s) |> Async.RunSynchronously - yield s.ToString(), uses ] - -(** -You can also look at all the symbols uses in the whole project (including uses of symbols with local scope) -*) -let allUsesOfAllSymbols = - wholeProjectResults.GetAllUsesOfAllSymbols() - |> Async.RunSynchronously - -(** -You can also request checks of updated versions of files within the project (note that the other files -in the project are still read from disk, unless you are using the [FileSystem API](filesystem.html)): - -*) - -let parseResults1, checkAnswer1 = - checker.ParseAndCheckFileInProject(Inputs.fileName1, 0, SourceText.ofString Inputs.fileSource1, projectOptions) - |> Async.RunSynchronously - -let checkResults1 = - match checkAnswer1 with - | FSharpCheckFileAnswer.Succeeded x -> x - | _ -> failwith "unexpected aborted" - -let parseResults2, checkAnswer2 = - checker.ParseAndCheckFileInProject(Inputs.fileName2, 0, SourceText.ofString Inputs.fileSource2, projectOptions) - |> Async.RunSynchronously - -let checkResults2 = - match checkAnswer2 with - | FSharpCheckFileAnswer.Succeeded x -> x - | _ -> failwith "unexpected aborted" - -(** -Again, you can resolve symbols and ask for references: -*) - -let xSymbolUse2Opt = - checkResults1.GetSymbolUseAtLocation(9,9,"",["xxx"]) - |> Async.RunSynchronously - -let xSymbolUse2 = xSymbolUse2Opt.Value - -let xSymbol2 = xSymbolUse2.Symbol - -let usesOfXSymbol2 = - wholeProjectResults.GetUsesOfSymbol(xSymbol2) - |> Async.RunSynchronously - - -(** -Or ask for all the symbols uses in the file (including uses of symbols with local scope) -*) -let allUsesOfAllSymbolsInFile1 = - checkResults1.GetAllUsesOfAllSymbolsInFile() - |> Async.RunSynchronously - -(** -Or ask for all the uses of one symbol in one file: -*) -let allUsesOfXSymbolInFile1 = - checkResults1.GetUsesOfSymbolInFile(xSymbol2) - |> Async.RunSynchronously - -let allUsesOfXSymbolInFile2 = - checkResults2.GetUsesOfSymbolInFile(xSymbol2) - |> Async.RunSynchronously - -(** - -Analyzing multiple projects ------------------------------ - -If you have multiple F# projects to analyze which include references from some projects to others, -then the simplest way to do this is to build the projects and specify the cross-project references using -a `-r:path-to-output-of-project.dll` argument in the ProjectOptions. However, this requires the build -of each project to succeed, producing the DLL file on disk which can be referred to. - -In some situations, e.g. in an IDE, you may wish to allow references to other F# projects prior to successful compilation to -a DLL. To do this, fill in the ProjectReferences entry in ProjectOptions, which recursively specifies the project -options for dependent projects. Each project reference still needs a corresponding `-r:path-to-output-of-project.dll` -command line argument in ProjectOptions, along with an entry in ProjectReferences. -The first element of each tuple in the ProjectReferences entry should be the DLL name, i.e. `path-to-output-of-project.dll`. -This should be the same as the text used in the `-r` project reference. - -When a project reference is used, the analysis will make use of the results of incremental -analysis of the referenced F# project from source files, without requiring the compilation of these files to DLLs. - -To efficiently analyze a set of F# projects which include cross-references, you should populate the ProjectReferences -correctly and then analyze each project in turn. - -*) - -(** - -> **NOTE:** Project references are disabled if the assembly being referred to contains type provider components - - specifying the project reference will have no effect beyond forcing the analysis of the project, and the DLL will - still be required on disk. - -*) - -(** -Summary -------- - -As you have seen, the `ParseAndCheckProject` lets you access results of project-wide analysis -such as symbol references. To learn more about working with symbols, see [Symbols](symbols.html). - -Using the FSharpChecker component in multi-project, incremental and interactive editing situations may involve -knowledge of the [FSharpChecker operations queue](queue.html) and the [FSharpChecker caches](caches.html). - -*) diff --git a/fcs/docsrc/content/queue.fsx b/fcs/docsrc/content/queue.fsx deleted file mode 100644 index 1a30a89e88..0000000000 --- a/fcs/docsrc/content/queue.fsx +++ /dev/null @@ -1,68 +0,0 @@ -(** ---- -category: how-to -title: Notes on the FSharpChecker operations queue -menu_order: 1 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Notes on the FSharpChecker operations queue -================================================= - -This is a design note on the FSharpChecker component and its operations queue. See also the notes on the [FSharpChecker caches](caches.html) - -FSharpChecker maintains an operations queue. Items from the FSharpChecker operations queue are processed -sequentially and in order. - -The thread processing these requests can also run a low-priority, interleaved background operation when the -queue is empty. This can be used to implicitly bring the background check of a project "up-to-date". -When the operations queue has been empty for 1 second, -this background work is run in small incremental fragments. This work is cooperatively time-sliced to be approximately <50ms, (see `maxTimeShareMilliseconds` in -IncrementalBuild.fs). The project to be checked in the background is set implicitly -by calls to ``CheckFileInProject`` and ``ParseAndCheckFileInProject``. -To disable implicit background checking completely, set ``checker.ImplicitlyStartBackgroundWork`` to false. -To change the time before background work starts, set ``checker.PauseBeforeBackgroundWork`` to the required number of milliseconds. - -Most calls to the FSharpChecker API enqueue an operation in the FSharpChecker compiler queue. These correspond to the -calls to EnqueueAndAwaitOpAsync in [service.fs](https://github.com/fsharp/FSharp.Compiler.Service/blob/master/src/fsharp/service/service.fs). - -* For example, calling `ParseAndCheckProject` enqueues a `ParseAndCheckProjectImpl` operation. The time taken for the - operation will depend on how much work is required to bring the project analysis up-to-date. - -* Likewise, calling any of `GetUsesOfSymbol`, `GetAllUsesOfAllSymbols`, `ParseFileInProject`, - `GetBackgroundParseResultsForFileInProject`, `MatchBraces`, `CheckFileInProjectIfReady`, `ParseAndCheckFileInProject`, `GetBackgroundCheckResultsForFileInProject`, - `ParseAndCheckProject`, `GetProjectOptionsFromScript`, `InvalidateConfiguration`, `InvaidateAll` and operations - on FSharpCheckResults will cause an operation to be enqueued. The length of the operation will - vary - many will be very fast - but they won't be processed until other operations already in the queue are complete. - -Some operations do not enqueue anything on the FSharpChecker operations queue - notably any accesses to the Symbol APIs. -These use cross-threaded access to the TAST data produced by other FSharpChecker operations. - -Some tools throw a lot of interactive work at the FSharpChecker operations queue. -If you are writing such a component, consider running your project against a debug build -of FSharp.Compiler.Service.dll to see the Trace.WriteInformation messages indicating the length of the -operations queue and the time to process requests. - -For those writing interactive editors which use FCS, you -should be cautious about operations that request a check of the entire project. -For example, be careful about requesting the check of an entire project -on operations like "Highlight Symbol" or "Find Unused Declarations" -(which run automatically when the user opens a file or moves the cursor). -as opposed to operations like "Find All References" (which a user explicitly triggers). -Project checking can cause long and contention on the FSharpChecker operations queue. - -Requests to FCS can be cancelled by cancelling the async operation. (Some requests also -include additional callbacks which can be used to indicate a cancellation condition). -This cancellation will be effective if the cancellation is performed before the operation -is executed in the operations queue. - -Summary -------- - -In this design note, you learned that the FSharpChecker component keeps an operations queue. When using FSharpChecker -in highly interactive situations, you should carefully consider the characteristics of the operations you are -enqueueing. -*) diff --git a/fcs/docsrc/content/react.fsx b/fcs/docsrc/content/react.fsx deleted file mode 100644 index 3bb8cbb73b..0000000000 --- a/fcs/docsrc/content/react.fsx +++ /dev/null @@ -1,82 +0,0 @@ -(** ---- -category: tutorial -title: Reacting to Changes -menu_order: 10 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Reacting to Changes -============================================ - -This tutorial discusses some technical aspects of how to make sure the F# compiler service is -providing up-to-date results especially when hosted in an IDE. See also [project wide analysis](project.html) -for information on project analysis. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published. - -The logical results of all "Check" routines (``ParseAndCheckFileInProject``, ``GetBackgroundCheckResultsForFileInProject``, -``TryGetRecentTypeCheckResultsForFile``, ``ParseAndCheckProject``) depend on results reported by the file system, -especially the ``IFileSystem`` implementation described in the tutorial on [project wide analysis](project.html). -Logically speaking, these results would be different if file system changes occur. For example, -referenced DLLs may change on disk, or referenced files may change. - -The ``FSharpChecker`` component from FSharp.Compiler.Service does _not_ actively "listen" -to changes in the file system. However ``FSharpChecker`` _does_ repeatedly ask for -time stamps from the file system which it uses to decide if recomputation is needed. -FCS doesn't listen for changes directly - for example, it creates no ``FileWatcher`` object (and the -``IFileSystem`` API has no ability to create such objects). This is partly for legacy reasons, -and partly because some hosts forbid the creation of FileWatcher objects. - -In most cases the repeated timestamp requests are sufficient. If you don't actively -listen for changes, then ``FSharpChecker`` will still do _approximately_ -the right thing, because it is asking for time stamps repeatedly. However, some updates on the file system -(such as a DLL appearing after a build, or the user randomly pasting a file into a folder) -may not actively be noticed by ``FSharpChecker`` until some operation happens to ask for a timestamp. -By issuing fresh requests, you can ensure that FCS actively reassesses the state of play when -stays up-to-date when changes are observed. - -If you want to more actively listen for changes, then you should add watchers for the -files specified in the ``DependencyFiles`` property of ``FSharpCheckFileResults`` and ``FSharpCheckProjectResults``. -Here�s what you need to do: - -* When your client notices an CHANGE event on a DependencyFile, it should schedule a refresh call to perform the ParseAndCheckFileInProject (or other operation) again. - This will result in fresh FileSystem calls to compute time stamps. - -* When your client notices an ADD event on a DependencyFile, it should call ``checker.InvalidateConfiguration`` - for all active projects in which the file occurs. This will result in fresh FileSystem calls to compute time - stamps, and fresh calls to compute whether files exist. - -* Generally clients don�t listen for DELETE events on files. Although it would be logically more consistent - to do so, in practice it�s very irritating for a "project clean" to invalidate all intellisense and - cause lots of red squiggles. Some source control tools also make a change by removing and adding files, which - is best noticed as a single change event. - - - -If your host happens to be Visual Studio, then this is one technique you can use: -* Listeners should be associated with a visual source file buffer -* Use fragments like this to watch the DependencyFiles: - - // Get the service - let vsFileWatch = fls.GetService(typeof) :?> IVsFileChangeEx - - // Watch the Add and Change events - let fileChangeFlags = - uint32 (_VSFILECHANGEFLAGS.VSFILECHG_Add ||| - // _VSFILECHANGEFLAGS.VSFILECHG_Del ||| // don't listen for deletes - if a file (such as a 'Clean'ed project reference) is deleted, just keep using stale info - _VSFILECHANGEFLAGS.VSFILECHG_Time) - - // Advise on file changes... - let cookie = Com.ThrowOnFailure1(vsFileWatch.AdviseFileChange(file, fileChangeFlags, changeEvents)) - - ... - - // Unadvised file changes... - Com.ThrowOnFailure0(vsFileWatch.UnadviseFileChange(cookie)) - - -*) diff --git a/fcs/docsrc/content/symbols.fsx b/fcs/docsrc/content/symbols.fsx deleted file mode 100644 index 426cdf34b5..0000000000 --- a/fcs/docsrc/content/symbols.fsx +++ /dev/null @@ -1,232 +0,0 @@ -(** ---- -category: tutorial -title: Working with symbols -menu_order: 4 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Working with symbols -============================================ - -This tutorial demonstrates how to work with symbols provided by the F# compiler. See also [project wide analysis](project.html) -for information on symbol references. - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published. - -As usual we start by referencing `FSharp.Compiler.Service.dll`, opening the relevant namespace and creating an instance -of `FSharpChecker`: - -*) -// Reference F# compiler API -#r "FSharp.Compiler.Service.dll" - -open System -open System.IO -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Text - -// Create an interactive checker instance -let checker = FSharpChecker.Create() - -(** - -We now perform type checking on the specified input: - -*) - -let parseAndTypeCheckSingleFile (file, input) = - // Get context representing a stand-alone (script) file - let projOptions, errors = - checker.GetProjectOptionsFromScript(file, input) - |> Async.RunSynchronously - - let parseFileResults, checkFileResults = - checker.ParseAndCheckFileInProject(file, 0, input, projOptions) - |> Async.RunSynchronously - - // Wait until type checking succeeds (or 100 attempts) - match checkFileResults with - | FSharpCheckFileAnswer.Succeeded(res) -> parseFileResults, res - | res -> failwithf "Parsing did not finish... (%A)" res - -let file = "/home/user/Test.fsx" - -(** -## Getting resolved signature information about the file - -After type checking a file, you can access the inferred signature of a project up to and including the -checking of the given file through the `PartialAssemblySignature` property of the `TypeCheckResults`. - -The full signature information is available for modules, types, attributes, members, values, functions, -union cases, record types, units of measure and other F# language constructs. - -The typed expression trees are also available, see [typed tree tutorial](typedtree.html). - -*) - -let input2 = - """ -[] -let foo(x, y) = - let msg = String.Concat("Hello"," ","world") - if true then - printfn "x = %d, y = %d" x y - printfn "%s" msg - -type C() = - member x.P = 1 - """ -let parseFileResults, checkFileResults = - parseAndTypeCheckSingleFile(file, SourceText.ofString input2) - -(** -Now get the partial assembly signature for the code: -*) -let partialAssemblySignature = checkFileResults.PartialAssemblySignature - -partialAssemblySignature.Entities.Count = 1 // one entity - - -(** -Now get the entity that corresponds to the module containing the code: -*) -let moduleEntity = partialAssemblySignature.Entities.[0] - -moduleEntity.DisplayName = "Test" - -(** -Now get the entity that corresponds to the type definition in the code: -*) -let classEntity = moduleEntity.NestedEntities.[0] - -(** -Now get the value that corresponds to the function defined in the code: -*) -let fnVal = moduleEntity.MembersFunctionsAndValues.[0] - -(** -Now look around at the properties describing the function value. All of the following evaluate to `true`: -*) -fnVal.Attributes.Count = 1 -fnVal.CurriedParameterGroups.Count // 1 -fnVal.CurriedParameterGroups.[0].Count // 2 -fnVal.CurriedParameterGroups.[0].[0].Name // "x" -fnVal.CurriedParameterGroups.[0].[1].Name // "y" -fnVal.DeclarationLocation.StartLine // 3 -fnVal.DisplayName // "foo" -fnVal.DeclaringEntity.Value.DisplayName // "Test" -fnVal.DeclaringEntity.Value.DeclarationLocation.StartLine // 1 -fnVal.GenericParameters.Count // 0 -fnVal.InlineAnnotation // FSharpInlineAnnotation.OptionalInline -fnVal.IsActivePattern // false -fnVal.IsCompilerGenerated // false -fnVal.IsDispatchSlot // false -fnVal.IsExtensionMember // false -fnVal.IsPropertyGetterMethod // false -fnVal.IsImplicitConstructor // false -fnVal.IsInstanceMember // false -fnVal.IsMember // false -fnVal.IsModuleValueOrMember // true -fnVal.IsMutable // false -fnVal.IsPropertySetterMethod // false -fnVal.IsTypeFunction // false - -(** -Now look at the type of the function if used as a first class value. (Aside: the `CurriedParameterGroups` property contains -more information like the names of the arguments.) -*) -fnVal.FullType // int * int -> unit -fnVal.FullType.IsFunctionType // int * int -> unit -fnVal.FullType.GenericArguments.[0] // int * int -fnVal.FullType.GenericArguments.[0].IsTupleType // int * int -let argTy1 = fnVal.FullType.GenericArguments.[0].GenericArguments.[0] - -argTy1.TypeDefinition.DisplayName // int - -(** -OK, so we got an object representation of the type `int * int -> unit`, and we have seen the first 'int'. We can find out more about the -type 'int' as follows, determining that it is a named type, which is an F# type abbreviation, `type int = int32`: -*) - -argTy1.HasTypeDefinition -argTy1.TypeDefinition.IsFSharpAbbreviation // "int" - -(** -We can now look at the right-hand-side of the type abbreviation, which is the type `int32`: -*) - -let argTy1b = argTy1.TypeDefinition.AbbreviatedType -argTy1b.TypeDefinition.Namespace // Some "Microsoft.FSharp.Core" -argTy1b.TypeDefinition.CompiledName // "int32" - -(** -Again we can now look through the type abbreviation `type int32 = System.Int32` to get the -full information about the type: -*) -let argTy1c = argTy1b.TypeDefinition.AbbreviatedType -argTy1c.TypeDefinition.Namespace // Some "SystemCore" -argTy1c.TypeDefinition.CompiledName // "Int32" - -(** -The type checking results for a file also contain information extracted from the project (or script) options -used in the compilation, called the `ProjectContext`: -*) -let projectContext = checkFileResults.ProjectContext - -for assembly in projectContext.GetReferencedAssemblies() do - match assembly.FileName with - | None -> printfn "compilation referenced an assembly without a file" - | Some s -> printfn "compilation references assembly '%s'" s - - -(** -**Notes:** - - - If incomplete code is present, some or all of the attributes may not be quite as expected. - - If some assembly references are missing (which is actually very, very common), then 'IsUnresolved' may - be true on values, members and/or entities related to external assemblies. You should be sure to make your - code robust against IsUnresolved exceptions. - -*) - -(** - -## Getting symbolic information about whole projects - -To check whole projects, create a checker, then call `parseAndCheckScript`. In this case, we just check -the project for a single script. By specifying a different "projOptions" you can create -a specification of a larger project. -*) -let parseAndCheckScript (file, input) = - let projOptions, errors = - checker.GetProjectOptionsFromScript(file, input) - |> Async.RunSynchronously - - checker.ParseAndCheckProject(projOptions) |> Async.RunSynchronously - -(** -Now do it for a particular input: -*) - -let tmpFile = Path.ChangeExtension(System.IO.Path.GetTempFileName() , "fs") -File.WriteAllText(tmpFile, input2) - -let projectResults = parseAndCheckScript(tmpFile, SourceText.ofString input2) - - -(** -Now look at the results: -*) - -let assemblySig = projectResults.AssemblySignature - -assemblySig.Entities.Count = 1 // one entity -assemblySig.Entities.[0].Namespace // one entity -assemblySig.Entities.[0].DisplayName // "Tmp28D0" -assemblySig.Entities.[0].MembersFunctionsAndValues.Count // 1 -assemblySig.Entities.[0].MembersFunctionsAndValues.[0].DisplayName // "foo" - diff --git a/fcs/docsrc/content/tokenizer.fsx b/fcs/docsrc/content/tokenizer.fsx deleted file mode 100644 index b3dfae8cb2..0000000000 --- a/fcs/docsrc/content/tokenizer.fsx +++ /dev/null @@ -1,139 +0,0 @@ -(** ---- -category: tutorial -title: F# Language Tokenizer -menu_order: 1 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Using the F# tokenizer -========================================= - -This tutorial demonstrates how to call the F# language tokenizer. Given F# -source code, the tokenizer generates a list of source code lines that contain -information about tokens on each line. For each token, you can get the type -of the token, exact location as well as color kind of the token (keyword, -identifier, number, operator, etc.). - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published - - -Creating the tokenizer ---------------------- - -To use the tokenizer, reference `FSharp.Compiler.Service.dll` and open the -`SourceCodeServices` namespace: -*) -#r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.SourceCodeServices -(** -Now you can create an instance of `FSharpSourceTokenizer`. The class takes two -arguments - the first is the list of defined symbols and the second is the -file name of the source code. The defined symbols are required because the -tokenizer handles `#if` directives. The file name is required only to specify -locations of the source code (and it does not have to exist): -*) -let sourceTok = FSharpSourceTokenizer([], Some "C:\\test.fsx") -(** -Using the `sourceTok` object, we can now (repeatedly) tokenize lines of -F# source code. - -Tokenizing F# code ------------------- - -The tokenizer operates on individual lines rather than on the entire source -file. After getting a token, the tokenizer also returns new state (as `int64` value). -This can be used to tokenize F# code more efficiently. When source code changes, -you do not need to re-tokenize the entire file - only the parts that have changed. - -### Tokenizing single line - -To tokenize a single line, we create a `FSharpLineTokenizer` by calling `CreateLineTokenizer` -on the `FSharpSourceTokenizer` object that we created earlier: -*) -let tokenizer = sourceTok.CreateLineTokenizer("let answer=42") -(** -Now, we can write a simple recursive function that calls `ScanToken` on the `tokenizer` -until it returns `None` (indicating the end of line). When the function succeeds, it -returns `FSharpTokenInfo` object with all the interesting details: -*) -/// Tokenize a single line of F# code -let rec tokenizeLine (tokenizer:FSharpLineTokenizer) state = - match tokenizer.ScanToken(state) with - | Some tok, state -> - // Print token name - printf "%s " tok.TokenName - // Tokenize the rest, in the new state - tokenizeLine tokenizer state - | None, state -> state -(** -The function returns the new state, which is needed if you need to tokenize multiple lines -and an earlier line ends with a multi-line comment. As an initial state, we can use `0L`: -*) -tokenizeLine tokenizer FSharpTokenizerLexState.Initial -(** -The result is a sequence of tokens with names LET, WHITESPACE, IDENT, EQUALS and INT32. -There is a number of interesting properties on `FSharpTokenInfo` including: - - - `CharClass` and `ColorClass` return information about the token category that - can be used for colorizing F# code. - - `LeftColumn` and `RightColumn` return the location of the token inside the line. - - `TokenName` is the name of the token (as defined in the F# lexer) - -Note that the tokenizer is stateful - if you want to tokenize single line multiple times, -you need to call `CreateLineTokenizer` again. - -### Tokenizing sample code - -To run the tokenizer on a longer sample code or an entire file, you need to read the -sample input as a collection of `string` values: -*) -let lines = """ - // Hello world - let hello() = - printfn "Hello world!" """.Split('\r','\n') -(** -To tokenize multi-line input, we again need a recursive function that keeps the current -state. The following function takes the lines as a list of strings (together with line number -and the current state). We create a new tokenizer for each line and call `tokenizeLine` -using the state from the *end* of the previous line: -*) -/// Print token names for multiple lines of code -let rec tokenizeLines state count lines = - match lines with - | line::lines -> - // Create tokenizer & tokenize single line - printfn "\nLine %d" count - let tokenizer = sourceTok.CreateLineTokenizer(line) - let state = tokenizeLine tokenizer state - // Tokenize the rest using new state - tokenizeLines state (count+1) lines - | [] -> () -(** -The function simply calls `tokenizeLine` (defined earlier) to print the names of all -the tokens on each line. We can call it on the previous input with `0L` as the initial -state and `1` as the number of the first line: -*) -lines -|> List.ofSeq -|> tokenizeLines FSharpTokenizerLexState.Initial 1 -(** -Ignoring some unimportant details (like whitespace at the beginning of each line and -the first line which is just whitespace), the code generates the following output: - - [lang=text] - Line 1 - LINE_COMMENT LINE_COMMENT (...) LINE_COMMENT - Line 2 - LET WHITESPACE IDENT LPAREN RPAREN WHITESPACE EQUALS - Line 3 - IDENT WHITESPACE STRING_TEXT (...) STRING_TEXT STRING - -It is worth noting that the tokenizer yields multiple `LINE_COMMENT` tokens and multiple -`STRING_TEXT` tokens for each single comment or string (roughly, one for each word), so -if you want to get the entire text of a comment/string, you need to concatenate the -tokens. -*) \ No newline at end of file diff --git a/fcs/docsrc/content/typedtree.fsx b/fcs/docsrc/content/typedtree.fsx deleted file mode 100644 index 81d67baaf0..0000000000 --- a/fcs/docsrc/content/typedtree.fsx +++ /dev/null @@ -1,316 +0,0 @@ -(** ---- -category: tutorial -title: Processing typed expression tree -menu_order: 5 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Processing typed expression tree -================================================= - -This tutorial demonstrates how to get the checked, typed expressions tree (TAST) -for F# code and how to walk over the tree. - -This can be used for creating tools such as source code analyzers and refactoring tools. -You can also combine the information with the API available -from [symbols](symbols.html). - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published - - -Getting checked expressions ------------------------ - -To access the type-checked, resolved expressions, you need to create an instance of `InteractiveChecker`. - -To use the interactive checker, reference `FSharp.Compiler.Service.dll` and open the -`SourceCodeServices` namespace: -*) -#r "FSharp.Compiler.Service.dll" -open System -open System.IO -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Text -(** - -### Checking code - -We first parse and check some code as in the [symbols](symbols.html) tutorial. -One difference is that we set keepAssemblyContents to true. - -*) -// Create an interactive checker instance -let checker = FSharpChecker.Create(keepAssemblyContents=true) - -let parseAndCheckSingleFile (input) = - let file = Path.ChangeExtension(System.IO.Path.GetTempFileName(), "fsx") - File.WriteAllText(file, input) - // Get context representing a stand-alone (script) file - let projOptions, _errors = - checker.GetProjectOptionsFromScript(file, SourceText.ofString input) - |> Async.RunSynchronously - - let fprojOptions = projOptions - - checker.ParseAndCheckProject (fprojOptions) - |> Async.RunSynchronously - -(** -## Getting the expressions - -After type checking a file, you can access the declarations and contents of the assembly, including expressions: - -*) - -let input2 = - """ -module MyLibrary - -open System - -let foo(x, y) = - let msg = String.Concat("Hello", " ", "world") - if msg.Length > 10 then - 10 - else - 20 - -type MyClass() = - member x.MyMethod() = 1 - """ -let checkProjectResults = - parseAndCheckSingleFile(input2) - -checkProjectResults.Errors // should be empty - - -(** - -Checked assemblies are made up of a series of checked implementation files. The "file" granularity -matters in F# because initialization actions are triggered at the granularity of files. -In this case there is only one implementation file in the project: - -*) - -let checkedFile = checkProjectResults.AssemblyContents.ImplementationFiles.[0] - -(** - -Checked assemblies are made up of a series of checked implementation files. The "file" granularity -matters in F# because initialization actions are triggered at the granularity of files. -In this case there is only one implementation file in the project: - -*) - -let rec printDecl prefix d = - match d with - | FSharpImplementationFileDeclaration.Entity (e, subDecls) -> - printfn "%sEntity %s was declared and contains %d sub-declarations" prefix e.CompiledName subDecls.Length - for subDecl in subDecls do - printDecl (prefix+" ") subDecl - | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue(v, vs, e) -> - printfn "%sMember or value %s was declared" prefix v.CompiledName - | FSharpImplementationFileDeclaration.InitAction(e) -> - printfn "%sA top-level expression was declared" prefix - - -for d in checkedFile.Declarations do - printDecl "" d - -// Entity MyLibrary was declared and contains 4 sub-declarations -// Member or value foo was declared -// Entity MyClass was declared and contains 0 sub-declarations -// Member or value .ctor was declared -// Member or value MyMethod was declared - -(** - -As can be seen, the only declaration in the implementation file is that of the module MyLibrary, which -contains fours sub-declarations. - -> As an aside, one peculiarity here is that the member declarations (e.g. the "MyMethod" member) are returned as part of the containing module entity, not as part of their class. - -> Note that the class constructor is returned as a separate declaration. The class type definition has been "split" into a constructor and the other declarations. - -*) - -let myLibraryEntity, myLibraryDecls = - match checkedFile.Declarations.[0] with - | FSharpImplementationFileDeclaration.Entity (e, subDecls) -> (e, subDecls) - | _ -> failwith "unexpected" - - -(** - -What about the expressions, for example the body of function "foo"? Let's find it: -*) - -let (fooSymbol, fooArgs, fooExpression) = - match myLibraryDecls.[0] with - | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue(v, vs, e) -> (v, vs, e) - | _ -> failwith "unexpected" - - -(** Here 'fooSymbol' is a symbol associated with the declaration of 'foo', -'fooArgs' represents the formal arguments to the 'foo' function, and 'fooExpression' -is an expression for the implementation of the 'foo' function. - -Once you have an expression, you can work with it much like an F# quotation. For example, -you can find its declaration range and its type: - -*) - -fooExpression.Type // shows that the return type of the body expression is 'int' -fooExpression.Range // shows the declaration range of the expression implementing 'foo' - -(** - -### Walking over expressions - - -Expressions are analyzed using active patterns, much like F# quotations. -Here is a generic expression visitor: - -*) - -let rec visitExpr f (e:FSharpExpr) = - f e - match e with - | BasicPatterns.AddressOf(lvalueExpr) -> - visitExpr f lvalueExpr - | BasicPatterns.AddressSet(lvalueExpr, rvalueExpr) -> - visitExpr f lvalueExpr; visitExpr f rvalueExpr - | BasicPatterns.Application(funcExpr, typeArgs, argExprs) -> - visitExpr f funcExpr; visitExprs f argExprs - | BasicPatterns.Call(objExprOpt, memberOrFunc, typeArgs1, typeArgs2, argExprs) -> - visitObjArg f objExprOpt; visitExprs f argExprs - | BasicPatterns.Coerce(targetType, inpExpr) -> - visitExpr f inpExpr - | BasicPatterns.FastIntegerForLoop(startExpr, limitExpr, consumeExpr, isUp) -> - visitExpr f startExpr; visitExpr f limitExpr; visitExpr f consumeExpr - | BasicPatterns.ILAsm(asmCode, typeArgs, argExprs) -> - visitExprs f argExprs - | BasicPatterns.ILFieldGet (objExprOpt, fieldType, fieldName) -> - visitObjArg f objExprOpt - | BasicPatterns.ILFieldSet (objExprOpt, fieldType, fieldName, valueExpr) -> - visitObjArg f objExprOpt - | BasicPatterns.IfThenElse (guardExpr, thenExpr, elseExpr) -> - visitExpr f guardExpr; visitExpr f thenExpr; visitExpr f elseExpr - | BasicPatterns.Lambda(lambdaVar, bodyExpr) -> - visitExpr f bodyExpr - | BasicPatterns.Let((bindingVar, bindingExpr), bodyExpr) -> - visitExpr f bindingExpr; visitExpr f bodyExpr - | BasicPatterns.LetRec(recursiveBindings, bodyExpr) -> - List.iter (snd >> visitExpr f) recursiveBindings; visitExpr f bodyExpr - | BasicPatterns.NewArray(arrayType, argExprs) -> - visitExprs f argExprs - | BasicPatterns.NewDelegate(delegateType, delegateBodyExpr) -> - visitExpr f delegateBodyExpr - | BasicPatterns.NewObject(objType, typeArgs, argExprs) -> - visitExprs f argExprs - | BasicPatterns.NewRecord(recordType, argExprs) -> - visitExprs f argExprs - | BasicPatterns.NewAnonRecord(recordType, argExprs) -> - visitExprs f argExprs - | BasicPatterns.NewTuple(tupleType, argExprs) -> - visitExprs f argExprs - | BasicPatterns.NewUnionCase(unionType, unionCase, argExprs) -> - visitExprs f argExprs - | BasicPatterns.Quote(quotedExpr) -> - visitExpr f quotedExpr - | BasicPatterns.FSharpFieldGet(objExprOpt, recordOrClassType, fieldInfo) -> - visitObjArg f objExprOpt - | BasicPatterns.AnonRecordGet(objExpr, recordOrClassType, fieldInfo) -> - visitExpr f objExpr - | BasicPatterns.FSharpFieldSet(objExprOpt, recordOrClassType, fieldInfo, argExpr) -> - visitObjArg f objExprOpt; visitExpr f argExpr - | BasicPatterns.Sequential(firstExpr, secondExpr) -> - visitExpr f firstExpr; visitExpr f secondExpr - | BasicPatterns.TryFinally(bodyExpr, finalizeExpr) -> - visitExpr f bodyExpr; visitExpr f finalizeExpr - | BasicPatterns.TryWith(bodyExpr, _, _, catchVar, catchExpr) -> - visitExpr f bodyExpr; visitExpr f catchExpr - | BasicPatterns.TupleGet(tupleType, tupleElemIndex, tupleExpr) -> - visitExpr f tupleExpr - | BasicPatterns.DecisionTree(decisionExpr, decisionTargets) -> - visitExpr f decisionExpr; List.iter (snd >> visitExpr f) decisionTargets - | BasicPatterns.DecisionTreeSuccess (decisionTargetIdx, decisionTargetExprs) -> - visitExprs f decisionTargetExprs - | BasicPatterns.TypeLambda(genericParam, bodyExpr) -> - visitExpr f bodyExpr - | BasicPatterns.TypeTest(ty, inpExpr) -> - visitExpr f inpExpr - | BasicPatterns.UnionCaseSet(unionExpr, unionType, unionCase, unionCaseField, valueExpr) -> - visitExpr f unionExpr; visitExpr f valueExpr - | BasicPatterns.UnionCaseGet(unionExpr, unionType, unionCase, unionCaseField) -> - visitExpr f unionExpr - | BasicPatterns.UnionCaseTest(unionExpr, unionType, unionCase) -> - visitExpr f unionExpr - | BasicPatterns.UnionCaseTag(unionExpr, unionType) -> - visitExpr f unionExpr - | BasicPatterns.ObjectExpr(objType, baseCallExpr, overrides, interfaceImplementations) -> - visitExpr f baseCallExpr - List.iter (visitObjMember f) overrides - List.iter (snd >> List.iter (visitObjMember f)) interfaceImplementations - | BasicPatterns.TraitCall(sourceTypes, traitName, typeArgs, typeInstantiation, argTypes, argExprs) -> - visitExprs f argExprs - | BasicPatterns.ValueSet(valToSet, valueExpr) -> - visitExpr f valueExpr - | BasicPatterns.WhileLoop(guardExpr, bodyExpr) -> - visitExpr f guardExpr; visitExpr f bodyExpr - | BasicPatterns.BaseValue baseType -> () - | BasicPatterns.DefaultValue defaultType -> () - | BasicPatterns.ThisValue thisType -> () - | BasicPatterns.Const(constValueObj, constType) -> () - | BasicPatterns.Value(valueToGet) -> () - | _ -> failwith (sprintf "unrecognized %+A" e) - -and visitExprs f exprs = - List.iter (visitExpr f) exprs - -and visitObjArg f objOpt = - Option.iter (visitExpr f) objOpt - -and visitObjMember f memb = - visitExpr f memb.Body - -(** -Let's use this expresssion walker: - -*) -fooExpression |> visitExpr (fun e -> printfn "Visiting %A" e) - -// Prints: -// -// Visiting Let... -// Visiting Call... -// Visiting Const ("Hello", ...) -// Visiting Const (" ", ...) -// Visiting Const ("world", ...) -// Visiting IfThenElse... -// Visiting Call... -// Visiting Call... -// Visiting Value ... -// Visiting Const ... -// Visiting Const ... -// Visiting Const ... - -(** -Note that - -* The visitExpr function is recursive (for nested expressions). - -* Pattern matching is removed from the tree, into a form called 'decision trees'. - -Summary -------- -In this tutorial, we looked at basic of working with checked declarations and expressions. - -In practice, it is also useful to combine the information here -with some information you can obtain from the [symbols](symbols.html) -tutorial. -*) diff --git a/fcs/docsrc/content/untypedtree.fsx b/fcs/docsrc/content/untypedtree.fsx deleted file mode 100644 index 3ae02331bf..0000000000 --- a/fcs/docsrc/content/untypedtree.fsx +++ /dev/null @@ -1,253 +0,0 @@ -(** ---- -category: tutorial -title: Processing untyped AST -menu_order: 2 - ---- -*) -(*** hide ***) -#I "../../../artifacts/bin/fcs/Release/netcoreapp3.0" -(** -Compiler Services: Processing untyped syntax tree -================================================= - -This tutorial demonstrates how to get the untyped abstract syntax tree (AST) -for F# code and how to walk over the tree. This can be used for creating tools -such as code formatter, basic refactoring or code navigation tools. The untyped -syntax tree contains information about the code structure, but does not contain -types and there are some ambiguities that are resolved only later by the type -checker. You can also combine the untyped AST information with the API available -from [editor services](editor.html). - -> **NOTE:** The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published - - -Getting the untyped AST ------------------------ - -To access the untyped AST, you need to create an instance of `FSharpChecker`. -This type represents a context for type checking and parsing and corresponds either -to a stand-alone F# script file (e.g. opened in Visual Studio) or to a loaded project -file with multiple files. Once you have an instance of `FSharpChecker`, you can -use it to perform "untyped parse" which is the first step of type-checking. The -second phase is "typed parse" and is used by [editor services](editor.html). - -To use the interactive checker, reference `FSharp.Compiler.Service.dll` and open the -`SourceCodeServices` namespace: -*) -#r "FSharp.Compiler.Service.dll" -open System -open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Text -(** - -### Performing untyped parse - -The untyped parse operation is very fast (compared to type checking, which can -take notable amount of time) and so we can perform it synchronously. First, we -need to create `FSharpChecker` - the constructor takes an argument that -can be used to notify the checker about file changes (which we ignore). - -*) -// Create an interactive checker instance -let checker = FSharpChecker.Create() -(** - -To get the AST, we define a function that takes file name and the source code -(the file is only used for location information and does not have to exist). -We first need to get "interactive checker options" which represents the context. -For simple tasks, you can use `GetProjectOptionsFromScriptRoot` which infers -the context for a script file. Then we use the `ParseFile` method and -return the `ParseTree` property: - -*) -/// Get untyped tree for a specified input -let getUntypedTree (file, input) = - // Get compiler options for the 'project' implied by a single script file - let projOptions, errors = - checker.GetProjectOptionsFromScript(file, input) - |> Async.RunSynchronously - - let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOptions) - - // Run the first phase (untyped parsing) of the compiler - let parseFileResults = - checker.ParseFile(file, input, parsingOptions) - |> Async.RunSynchronously - - match parseFileResults.ParseTree with - | Some tree -> tree - | None -> failwith "Something went wrong during parsing!" - -(** - -Walking over the AST --------------------- - -The abstract syntax tree is defined as a number of discriminated unions that represent -different syntactical elements (such as expressions, patterns, declarations etc.). The best -way to understand the AST is to look at the definitions in [`ast.fs` in the source -code](https://github.com/fsharp/fsharp/blob/master/src/fsharp/ast.fs#L464). - -The relevant parts are in the following namespace: -*) -open FSharp.Compiler.SyntaxTree -(** - -When processing the AST, you will typically write a number of mutually recursive functions -that pattern match on the different syntactical elements. There is a number of elements -that need to be supported - the top-level element is module or namespace declaration, -containing declarations inside a module (let bindings, types etc.). A let declaration inside -a module then contains expression, which can contain patterns. - -### Walking over patterns and expressions - -We start by looking at functions that walk over expressions and patterns - as we walk, -we print information about the visited elements. For patterns, the input is of type -`SynPat` and has a number of cases including `Wild` (for `_` pattern), `Named` (for -` as name`) and `LongIdent` (for a `Foo.Bar` name). Note that the parsed pattern -is occasionally more complex than what is in the source code (in particular, `Named` is -used more often): -*) -/// Walk over a pattern - this is for example used in -/// let = or in the 'match' expression -let rec visitPattern = function - | SynPat.Wild(_) -> - printfn " .. underscore pattern" - | SynPat.Named(pat, name, _, _, _) -> - visitPattern pat - printfn " .. named as '%s'" name.idText - | SynPat.LongIdent(LongIdentWithDots(ident, _), _, _, _, _, _) -> - let names = String.concat "." [ for i in ident -> i.idText ] - printfn " .. identifier: %s" names - | pat -> printfn " .. other pattern: %A" pat -(** -The function is recursive (for nested patterns such as `(foo, _) as bar`), but it does not -call any of the functions defined later (because patterns cannot contain other syntactical -elements). - -The next function iterates over expressions - this is where most of the work would be and -there are around 20 cases to cover (type `SynExpr.` and you'll get completion with other -options). In the following, we only show how to handle `if .. then ..` and `let .. = ...`: -*) -/// Walk over an expression - if expression contains two or three -/// sub-expressions (two if the 'else' branch is missing), let expression -/// contains pattern and two sub-expressions -let rec visitExpression = function - | SynExpr.IfThenElse(cond, trueBranch, falseBranchOpt, _, _, _, _) -> - // Visit all sub-expressions - printfn "Conditional:" - visitExpression cond - visitExpression trueBranch - falseBranchOpt |> Option.iter visitExpression - - | SynExpr.LetOrUse(_, _, bindings, body, _) -> - // Visit bindings (there may be multiple - // for 'let .. = .. and .. = .. in ...' - printfn "LetOrUse with the following bindings:" - for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, init, m, sp)) = binding - visitPattern pat - visitExpression init - // Visit the body expression - printfn "And the following body:" - visitExpression body - | expr -> printfn " - not supported expression: %A" expr -(** -The `visitExpression` function will be called from a function that visits all top-level -declarations inside a module. In this tutorial, we ignore types and members, but that would -be another source of calls to `visitExpression`. - -### Walking over declarations - -As mentioned earlier, the AST of a file contains a number of module or namespace declarations -(top-level node) that contain declarations inside a module (let bindings or types) or inside -a namespace (just types). The following functions walks over declarations - we ignore types, -nested modules and all other elements and look only at top-level `let` bindings (values and -functions): -*) -/// Walk over a list of declarations in a module. This is anything -/// that you can write as a top-level inside module (let bindings, -/// nested modules, type declarations etc.) -let visitDeclarations decls = - for declaration in decls do - match declaration with - | SynModuleDecl.Let(isRec, bindings, range) -> - // Let binding as a declaration is similar to let binding - // as an expression (in visitExpression), but has no body - for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, body, m, sp)) = binding - visitPattern pat - visitExpression body - | _ -> printfn " - not supported declaration: %A" declaration -(** -The `visitDeclarations` function will be called from a function that walks over a -sequence of module or namespace declarations. This corresponds, for example, to a file -with multiple `namespace Foo` declarations: -*) -/// Walk over all module or namespace declarations -/// (basically 'module Foo =' or 'namespace Foo.Bar') -/// Note that there is one implicitly, even if the file -/// does not explicitly define it.. -let visitModulesAndNamespaces modulesOrNss = - for moduleOrNs in modulesOrNss do - let (SynModuleOrNamespace(lid, isRec, isMod, decls, xml, attrs, _, m)) = moduleOrNs - printfn "Namespace or module: %A" lid - visitDeclarations decls -(** -Now that we have functions that walk over the elements of the AST (starting from declaration, -down to expressions and patterns), we can get AST of a sample input and run the above function. - -Putting things together ------------------------ - -As already discussed, the `getUntypedTree` function uses `FSharpChecker` to run the first -phase (parsing) on the AST and get back the tree. The function requires F# source code together -with location of the file. The location does not have to exist (it is used only for location -information) and it can be in both Unix and Windows formats: -*) -// Sample input for the compiler service -let input = - """ - let foo() = - let msg = "Hello world" - if true then - printfn "%s" msg - """ - -// File name in Unix format -let file = "/home/user/Test.fsx" - -// Get the AST of sample F# code -let tree = getUntypedTree(file, SourceText.ofString input) -(** -When you run the code in F# interactive, you can enter `tree;;` in the interactive console and -see pretty printed representation of the data structure - the tree contains a lot of information, -so this is not particularly readable, but it gives you good idea about how the tree looks. - -The returned `tree` value is again a discriminated union that can be two different cases - one case -is `ParsedInput.SigFile` which represents F# signature file (`*.fsi`) and the other one is -`ParsedInput.ImplFile` representing regular source code (`*.fsx` or `*.fs`). The implementation -file contains a sequence of modules or namespaces that we can pass to the function implemented -in the previous step: -*) -// Extract implementation file details -match tree with -| ParsedInput.ImplFile(implFile) -> - // Extract declarations and walk over them - let (ParsedImplFileInput(fn, script, name, _, _, modules, _)) = implFile - visitModulesAndNamespaces modules -| _ -> failwith "F# Interface file (*.fsi) not supported." -(** -Summary -------- -In this tutorial, we looked at basic of working with the untyped abstract syntax tree. This is a -comprehensive topic, so it is not possible to explain everything in a single article. The -[Fantomas project](https://github.com/dungpa/fantomas) is a good example of tool based on the untyped -AST that can help you understand more. In practice, it is also useful to combine the information here -with some information you can obtain from the [editor services](editor.html) discussed in the next -tutorial. -*) diff --git a/fcs/docsrc/generators/apiref.fsx b/fcs/docsrc/generators/apiref.fsx deleted file mode 100644 index dac5b008f0..0000000000 --- a/fcs/docsrc/generators/apiref.fsx +++ /dev/null @@ -1,302 +0,0 @@ -#r "../_lib/Fornax.Core.dll" -#r "../../packages/docs/Newtonsoft.Json/lib/netstandard2.0/Newtonsoft.Json.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.CodeFormat.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.Markdown.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.Literate.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.MetadataFormat.dll" - -#if !FORNAX -#load "../loaders/apirefloader.fsx" -#endif - -#load "partials/layout.fsx" - -open System -open FSharp.MetadataFormat -open Html -open Apirefloader -open FSharp.Literate -open FSharp.CodeFormat - -let tokenToCss (x: TokenKind) = - match x with - | TokenKind.Keyword -> "hljs-keyword" - | TokenKind.String -> "hljs-string" - | TokenKind.Comment -> "hljs-comment" - | TokenKind.Identifier -> "hljs-function" - | TokenKind.Inactive -> "" - | TokenKind.Number -> "hljs-number" - | TokenKind.Operator -> "hljs-keyword" - | TokenKind.Punctuation -> "hljs-keyword" - | TokenKind.Preprocessor -> "hljs-comment" - | TokenKind.Module -> "hljs-type" - | TokenKind.ReferenceType -> "hljs-type" - | TokenKind.ValueType -> "hljs-type" - | TokenKind.Interface -> "hljs-type" - | TokenKind.TypeArgument -> "hljs-type" - | TokenKind.Property -> "hljs-function" - | TokenKind.Enumeration -> "hljs-type" - | TokenKind.UnionCase -> "hljs-type" - | TokenKind.Function -> "hljs-function" - | TokenKind.Pattern -> "hljs-function" - | TokenKind.MutableVar -> "hljs-symbol" - | TokenKind.Disposable -> "hljs-symbol" - | TokenKind.Printf -> "hljs-regexp" - | TokenKind.Escaped -> "hljs-regexp" - | TokenKind.Default -> "" - - -let getComment (c: Comment) : string = - let t = - c.RawData - |> List.map (fun n -> n.Value) - |> String.concat "\n\n" - let doc = Literate.ParseMarkdownString t - Literate.WriteHtml(doc, lineNumbers = false, tokenKindToCss = tokenToCss) - .Replace("lang=\"fsharp", "class=\"language-fsharp") - - -let formatMember (m: Member) = - let attributes = - m.Attributes - |> List.filter (fun a -> a.FullName <> "Microsoft.FSharp.Core.CustomOperationAttribute") - - let hasCustomOp = - m.Attributes - |> List.exists (fun a -> a.FullName = "Microsoft.FSharp.Core.CustomOperationAttribute") - - let customOp = - if hasCustomOp then - m.Attributes - |> List.tryFind (fun a -> a.FullName = "Microsoft.FSharp.Core.CustomOperationAttribute") - |> Option.bind (fun a -> - a.ConstructorArguments - |> Seq.tryFind (fun x -> x :? string) - |> Option.map (fun x -> x.ToString()) - ) - |> Option.defaultValue "" - else - "" - - tr [] [ - td [] [ - code [] [!! m.Name] - br [] - - if hasCustomOp then - b [] [!! "CE Custom Operation: "] - code [] [!!customOp] - br [] - br [] - b [] [!! "Signature: "] - !!m.Details.Signature - br [] - if not (attributes.IsEmpty) then - b [] [!! "Attributes:"] - for a in attributes do - code [] [!! (a.Name)] - ] - td [] [!! (getComment m.Comment)] - ] - -let generateType ctx (page: ApiPageInfo) = - let t = page.Info - let body = - div [Class "api-page"] [ - h2 [] [!! t.Name] - b [] [!! "Namespace: "] - a [Href (sprintf "%s.html" page.NamespaceUrlName) ] [!! page.NamespaceName] - br [] - b [] [!! "Parent: "] - a [Href (sprintf "%s.html" page.ParentUrlName)] [!! page.ParentName] - span [] [!! (getComment t.Comment)] - br [] - if not (String.IsNullOrWhiteSpace t.Category) then - b [] [!! "Category:"] - !!t.Category - br [] - if not (t.Attributes.IsEmpty) then - b [] [!! "Attributes:"] - for a in t.Attributes do - br [] - code [] [!! (a.Name)] - br [] - - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Name"] - th [ Width "65%"] [!!"Description"] - ] - if not t.Constructors.IsEmpty then tr [] [ td [ColSpan 3. ] [ b [] [!! "Constructors"]]] - yield! t.Constructors |> List.map formatMember - - if not t.InstanceMembers.IsEmpty then tr [] [ td [ColSpan 3. ] [ b [] [!! "Instance Members"]]] - yield! t.InstanceMembers |> List.map formatMember - - if not t.RecordFields.IsEmpty then tr [] [ td [ColSpan 3. ] [ b [] [!! "Record Fields"]]] - yield! t.RecordFields |> List.map formatMember - - if not t.StaticMembers.IsEmpty then tr [] [ td [ColSpan 3. ] [ b [] [!! "Static Members"]]] - yield! t.StaticMembers |> List.map formatMember - - if not t.StaticParameters.IsEmpty then tr [] [ td [ColSpan 3. ] [ b [] [!! "Static Parameters"]]] - yield! t.StaticParameters |> List.map formatMember - - if not t.UnionCases.IsEmpty then tr [] [ td [ColSpan 3. ] [ b [] [!! "Union Cases"]]] - yield! t.UnionCases |> List.map formatMember - ] - ] - t.UrlName, Layout.layout ctx [body] t.Name - -let generateModule ctx (page: ApiPageInfo) = - let m = page.Info - let body = - div [Class "api-page"] [ - h2 [] [!!m.Name] - b [] [!! "Namespace: "] - a [Href (sprintf "%s.html" page.NamespaceUrlName) ] [!! page.NamespaceName] - br [] - b [] [!! "Parent: "] - a [Href (sprintf "%s.html" page.ParentUrlName)] [!! page.ParentName] - span [] [!! (getComment m.Comment)] - br [] - if not (String.IsNullOrWhiteSpace m.Category) then - b [] [!! "Category:"] - !!m.Category - br [] - - if not m.NestedTypes.IsEmpty then - b [] [!! "Declared Types"] - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Type"] - th [ Width "65%"] [!!"Description"] - ] - for t in m.NestedTypes do - tr [] [ - td [] [a [Href (sprintf "%s.html" t.UrlName )] [!! t.Name ]] - td [] [!! (getComment t.Comment)] - ] - ] - br [] - - if not m.NestedModules.IsEmpty then - b [] [!! "Declared Modules"] - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Module"] - th [ Width "65%"] [!!"Description"] - ] - for t in m.NestedModules do - tr [] [ - td [] [a [Href (sprintf "%s.html" t.UrlName )] [!! t.Name ]] - td [] [!! (getComment t.Comment)] - ] - ] - br [] - - if not m.ValuesAndFuncs.IsEmpty then - b [] [!! "Values and Functions"] - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Name"] - th [ Width "65%"] [!!"Description"] - ] - yield! m.ValuesAndFuncs |> List.map formatMember - ] - br [] - - if not m.TypeExtensions.IsEmpty then - b [] [!! "Type Extensions"] - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Name"] - th [ Width "65%"] [!!"Description"] - ] - yield! m.TypeExtensions |> List.map formatMember - ] - ] - m.UrlName, Layout.layout ctx [body] m.Name - -let generateNamespace ctx (n: Namespace) = - let body = - div [Class "api-page"] [ - h2 [] [!!n.Name] - - if not n.Types.IsEmpty then - - b [] [!! "Declared Types"] - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Type"] - th [ Width "65%"] [!!"Description"] - ] - for t in n.Types do - tr [] [ - td [] [a [Href (sprintf "%s.html" t.UrlName )] [!! t.Name ]] - td [] [!!(getComment t.Comment)] - ] - ] - br [] - - if not n.Modules.IsEmpty then - - b [] [!! "Declared Modules"] - table [] [ - tr [] [ - th [ Width "35%" ] [!!"Module"] - th [ Width "65%"] [!!"Description"] - ] - for t in n.Modules do - tr [] [ - td [] [a [Href (sprintf "%s.html" t.UrlName )] [!! t.Name ]] - td [] [!! (getComment t.Comment)] - ] - ] - ] - n.Name, Layout.layout ctx [body] (n.Name) - - -let generate' (ctx : SiteContents) = - let all = ctx.TryGetValue() - match all with - | None -> [] - | Some assyEntities -> - let name = assyEntities.GeneratorOutput.AssemblyGroup.Name - let namespaces = - assyEntities.GeneratorOutput.AssemblyGroup.Namespaces - |> List.map (generateNamespace ctx) - - let modules = - assyEntities.Modules - |> Seq.map (generateModule ctx) - - let types = - assyEntities.Types - |> Seq.map (generateType ctx) - - let ref = - Layout.layout ctx [ - h1 [] [!! name ] - b [] [!! "Declared namespaces"] - br [] - for (n, _) in namespaces do - a [Href (sprintf "%s.html" n)] [!!n] - br [] - ] assyEntities.Label - - [("index" , ref); yield! namespaces; yield! modules; yield! types] - - -let generate (ctx : SiteContents) (projectRoot: string) (page: string) = - try - printfn "generate api ref pages" - let results = - generate' ctx - |> List.map (fun (n,b) -> n, (Layout.render ctx b)) - printfn "generated api ref pages" - results - with - | ex -> - printfn "ERROR IN API REF GENERATION:\n%A" ex - [] diff --git a/fcs/docsrc/generators/lunr.fsx b/fcs/docsrc/generators/lunr.fsx deleted file mode 100644 index 9fec38d153..0000000000 --- a/fcs/docsrc/generators/lunr.fsx +++ /dev/null @@ -1,86 +0,0 @@ -#r "../_lib/Fornax.Core.dll" -#r "../../packages/docs/Newtonsoft.Json/lib/netstandard2.0/Newtonsoft.Json.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.MetadataFormat.dll" - -#if !FORNAX -#load "../loaders/contentloader.fsx" -#load "../loaders/apirefloader.fsx" -#load "../loaders/globalloader.fsx" -#endif - -open Apirefloader -open FSharp.MetadataFormat - - -type Entry = { - uri: string - title: string - content: string -} - -let generate (ctx : SiteContents) (projectRoot: string) (page: string) = - printfn "generating search index" - try - let siteInfo = ctx.TryGetValue().Value - let rootUrl = siteInfo.root_url - let pages = ctx.TryGetValues () |> Option.defaultValue Seq.empty - let entries = - pages - |> Seq.map (fun n -> - {uri = rootUrl.subRoute (n.link.Replace("content/", "")); title = n.title; content = n.text} - ) - - let all = ctx.TryGetValue() - let refs = - match all with - | None -> [] - | Some assembyEntities -> - let generatorOutput = assembyEntities.GeneratorOutput - let allModules = assembyEntities.Modules - let allTypes = assembyEntities.Types - - let gen = - let ctn = - sprintf "%s \n %s" generatorOutput.AssemblyGroup.Name (generatorOutput.AssemblyGroup.Namespaces |> Seq.map (fun n -> n.Name) |> String.concat " ") - {uri = (rootUrl.subRoute "/reference/index.html"); title = sprintf "%s - API Reference" assembyEntities.Label; content = ctn } - - let mdlsGen = - allModules - |> Seq.map (fun m -> - let m = m.Info - let cnt = - sprintf "%s \n %s \n %s \n %s \n %s \n %s" - m.Name - m.Comment.FullText - (m.NestedModules |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ") - (m.NestedTypes |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ") - (m.ValuesAndFuncs |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ") - (m.TypeExtensions |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ") - - - {uri = rootUrl.subRoutef "/reference/%s.html" m.UrlName ; title = m.Name; content = cnt } - ) - - let tsGen = - allTypes - |> Seq.map (fun m -> - let m = m.Info - let cnt = - sprintf "%s \n %s \n %s" - m.Name - m.Comment.FullText - (m.AllMembers |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ") - - - {uri = rootUrl.subRoutef "/reference/%s.html" m.UrlName ; title = m.Name; content = cnt } - ) - [yield! entries; gen; yield! mdlsGen; yield! tsGen] - - printfn "generated search index" - [|yield! entries; yield! refs|] - |> Newtonsoft.Json.JsonConvert.SerializeObject - with - | e -> - failwithf "error while generating index for %s\n%A" page e - - diff --git a/fcs/docsrc/generators/page.fsx b/fcs/docsrc/generators/page.fsx deleted file mode 100644 index db52b8e7b2..0000000000 --- a/fcs/docsrc/generators/page.fsx +++ /dev/null @@ -1,27 +0,0 @@ -#r "../_lib/Fornax.Core.dll" - -#load "./partials/layout.fsx" - -open Html - - -let generate' (ctx : SiteContents) (page: string) = - let posts = - ctx.TryGetValues () - |> Option.defaultValue Seq.empty - |> Seq.map (fun post -> sprintf "content/%s" post.file, post) - |> Map.ofSeq - - match posts |> Map.tryFind page with - | Some post -> - try - Layout.layout ctx [ !! post.content ] post.title - with - | e -> failwithf "Error while generating page for post %s\n%A" page e - | None -> - let allPostPaths = posts |> Map.toList |> List.map (fst >> fun s -> "* " + s) |> List.sort |> String.concat "\n" - failwithf "Couldn't find page '%s' in available posts. Known posts are:\n%s" page allPostPaths - -let generate (ctx : SiteContents) (projectRoot: string) (page: string) = - generate' ctx page - |> Layout.render ctx diff --git a/fcs/docsrc/generators/partials/footer.fsx b/fcs/docsrc/generators/partials/footer.fsx deleted file mode 100644 index db7c4c001b..0000000000 --- a/fcs/docsrc/generators/partials/footer.fsx +++ /dev/null @@ -1,37 +0,0 @@ -#r "../../_lib/Fornax.Core.dll" -#if !FORNAX -#load "../../loaders/contentloader.fsx" -#load "../../loaders/pageloader.fsx" -#load "../../loaders/globalloader.fsx" -#endif - -open Html - - - -let footer (ctx : SiteContents) = - let siteInfo = ctx.TryGetValue().Value - let rootUrl = siteInfo.root_url - - [ - div [Custom("style", "left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;")] [ - div [Custom("style", "border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;")] [] - ] - script [Src (rootUrl.subRoute "/static/js/clipboard.min.js")] [] - script [Src (rootUrl.subRoute "/static/js/perfect-scrollbar.min.js")] [] - script [Src (rootUrl.subRoute "/static/js/perfect-scrollbar.jquery.min.js")] [] - script [Src (rootUrl.subRoute "/static/js/jquery.sticky.js")] [] - script [Src (rootUrl.subRoute "/static/js/featherlight.min.js")] [] - script [Src (rootUrl.subRoute "/static/js/modernizr.custom-3.6.0.js")] [] - script [Src (rootUrl.subRoute "/static/js/learn.js")] [] - script [Src (rootUrl.subRoute "/static/js/hugo-learn.js")] [] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/mermaid/mermaid.css")] - script [Src (rootUrl.subRoute "/static/mermaid/mermaid.js")] [] - script [] [!! "mermaid.initialize({ startOnLoad: true });"] - script [Src "////cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/highlight.min.js"] [] - script [Src "//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/languages/fsharp.min.js"] [] - script [] [ - !! "hljs.initHighlightingOnLoad()" - ] - script [Src (rootUrl.subRoute "/static/js/tips.js")] [] - ] diff --git a/fcs/docsrc/generators/partials/header.fsx b/fcs/docsrc/generators/partials/header.fsx deleted file mode 100644 index bb424422ae..0000000000 --- a/fcs/docsrc/generators/partials/header.fsx +++ /dev/null @@ -1,31 +0,0 @@ -#r "../../_lib/Fornax.Core.dll" -#if !FORNAX -#load "../../loaders/contentloader.fsx" -#load "../../loaders/pageloader.fsx" -#load "../../loaders/globalloader.fsx" -#endif - -open Html - -let header (ctx : SiteContents) page = - let siteInfo = ctx.TryGetValue().Value - let rootUrl = siteInfo.root_url - - head [] [ - meta [CharSet "utf-8"] - meta [Name "viewport"; Content "width=device-width, initial-scale=1"] - title [] [!! (siteInfo.title + " | " + page)] - link [Rel "icon"; Type "image/png"; Sizes "32x32"; Href (rootUrl.subRoute "/static/images/favicon.png")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/nucleus.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/fontawesome-all.min.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/hybrid.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/featherlight.min.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/perfect-scrollbar.min.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/auto-complete.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/atom-one-dark-reasonable.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/theme.css")] - link [Rel "stylesheet"; Href (rootUrl.subRoute "/static/css/tips.css")] - link [Rel "stylesheet"; Href "//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/styles/atom-one-dark.min.css"] - link [Rel "stylesheet"; Href (rootUrl.subRoutef "/static/css/theme-%s.css" ((siteInfo.theme_variant.ToString().ToLower()))) ] - script [Src (rootUrl.subRoute "/static/js/jquery-3.3.1.min.js")] [] - ] diff --git a/fcs/docsrc/generators/partials/layout.fsx b/fcs/docsrc/generators/partials/layout.fsx deleted file mode 100644 index 62262c067f..0000000000 --- a/fcs/docsrc/generators/partials/layout.fsx +++ /dev/null @@ -1,65 +0,0 @@ -#r "../../_lib/Fornax.Core.dll" -#if !FORNAX -#load "../../loaders/contentloader.fsx" -#load "../../loaders/pageloader.fsx" -#load "../../loaders/globalloader.fsx" -#endif -#load "menu.fsx" -#load "header.fsx" -#load "footer.fsx" - -open Html - -let injectWebsocketCode (webpage:string) = - let websocketScript = - """ - - """ - let head = "" - let index = webpage.IndexOf head - webpage.Insert ( (index + head.Length + 1),websocketScript) - - -let layout (ctx : SiteContents) bodyCnt (page: string) = - - html [Class "js csstransforms3d"] [ - Header.header ctx page - body [] [ - Menu.menu ctx page - section [Id "body"] [ - div [Id "overlay"] [] - div [ Class "padding highlightable"] [ - div [Id "body-inner"] [ - span [Id "sidebar-toggle-span"] [ - a [Href "#"; Id "sidebar-toggle"; Custom("data-sidebar-toggle", "") ] [ - i [Class "fas fa-bars"] [] - !! " navigation" - ] - ] - yield! bodyCnt - ] - ] - ] - yield! Footer.footer ctx - ] - ] - -let render (ctx : SiteContents) cnt = - let disableLiveRefresh = ctx.TryGetValue () |> Option.map (fun n -> n.disableLiveRefresh) |> Option.defaultValue false - cnt - |> HtmlElement.ToString - |> fun n -> if disableLiveRefresh then n else injectWebsocketCode n diff --git a/fcs/docsrc/generators/partials/menu.fsx b/fcs/docsrc/generators/partials/menu.fsx deleted file mode 100644 index 1831236485..0000000000 --- a/fcs/docsrc/generators/partials/menu.fsx +++ /dev/null @@ -1,158 +0,0 @@ -#r "../../_lib/Fornax.Core.dll" -#if !FORNAX -#load "../../loaders/apirefloader.fsx" -#load "../../loaders/contentloader.fsx" -#load "../../loaders/pageloader.fsx" -#load "../../loaders/globalloader.fsx" -#endif - -open Html - - -let menu (ctx : SiteContents) (page: string) = - let shortcuts = ctx.GetValues () - let apiRef = ctx.TryGetValue() - - let content = ctx.GetValues () - let siteInfo = ctx.TryGetValue().Value - let rootUrl = siteInfo.root_url - - let language = - content - |> Seq.tryFind (fun r -> r.title = page) - |> Option.bind (fun r -> r.language) - - let group = content |> Seq.tryFind (fun n -> n.title = page) |> Option.map (fun n -> n.category) - - let explanations = - content - |> Seq.filter (fun n -> n.category = Contentloader.Explanation && not n.hide_menu && n.language = language ) - |> Seq.sortBy (fun n -> n.menu_order) - - let tutorials = - content - |> Seq.filter (fun n -> n.category = Contentloader.Tutorial && not n.hide_menu && n.language = language ) - |> Seq.sortBy (fun n -> n.menu_order) - - let howtos = - content - |> Seq.filter (fun n -> n.category = Contentloader.HowTo && not n.hide_menu && n.language = language ) - |> Seq.sortBy (fun n -> n.menu_order) - - let hasTutorials = not (Seq.isEmpty tutorials) - let hasExplanations = not (Seq.isEmpty explanations) - let hasHowTos = not (Seq.isEmpty howtos) - - let menuHeader = - [ - if hasExplanations then - li [Id "menu-explanations"; if group = Some Contentloader.Explanation then Class "dd-item menu-group-link menu-group-link-active" else Class "dd-item menu-group-link"; ] [ - a [] [!! "Explanation"] - ] - if hasTutorials then - li [Id "menu-tutorials"; if group = Some Contentloader.Tutorial then Class "dd-item menu-group-link menu-group-link-active" else Class "dd-item menu-group-link"; ] [ - a [] [!! "Tutorials"] - ] - if hasHowTos then - li [Id "menu-howtos"; if group = Some Contentloader.HowTo then Class "dd-item menu-group-link menu-group-link-active" else Class "dd-item menu-group-link"; ] [ - a [] [!! "How-To Guides"] - ] - li [ Id "menu-refs"; if group = None then Class "dd-item menu-group-link menu-group-link-active" else Class "dd-item menu-group-link";] [ - a [Href (rootUrl.subRoute "/reference/index.html")] [!! "API Reference"] - ] - ] - - let renderExpls = - ul [Id "submenu-explanations"; if group = Some Contentloader.Explanation then Class "submenu submenu-active" else Class "submenu"; ] [ - for r in explanations -> - li [] [ - a [Href (rootUrl.subRoute r.link); if r.title = page then Class "active-link padding" else Class "padding"] [ - !! r.title - ] - ] - ] - - let renderTuts = - ul [Id "submenu-tutorials"; if group = Some Contentloader.Tutorial then Class "submenu submenu-active" else Class "submenu"; ] [ - for r in tutorials -> - li [] [ - a [ Href (rootUrl.subRoute r.link); if r.title = page then Class "active-link padding" else Class "padding" ] [ - !! r.title - ] - ] - ] - - let renderHowTos = - ul [Id "submenu-howtos"; if group = Some Contentloader.HowTo then Class "submenu submenu-active" else Class "submenu"; ] [ - for r in howtos -> - li [] [ - a [Href (rootUrl.subRoute r.link); if r.title = page then Class "active-link padding" else Class "padding" ] [ - !! r.title - ] - ] - ] - - let renderLanguages = - section [Id "languages"] [ - h3 [] [!! "Languages"] - ul [] [ - li [] [ - a [Href (rootUrl.subRoute "/index.html"); if language = None then Class "menu-group-link-active padding" else Class "padding" ] [ - !! "English" - ] - ] - li [] [ - a [Href (rootUrl.subRoute "/ja/index.html"); if language = Some "ja" then Class "menu-group-link-active padding" else Class "padding" ] [ - !! "Japanese" - ] - ] - ] - ] - - let renderShortucuts = - section [Id "shortcuts"] [ - h3 [] [!! "Shortcuts"] - ul [] [ - for s in shortcuts do - yield - li [] [ - a [Class "padding"; Href s.link ] [ - i [Class s.icon] [] - !! s.title - ] - ] - ] - ] - - let renderFooter = - section [Id "footer"] [ - !! """

Built with Fornax""" - ] - - - nav [Id "sidebar"] [ - div [Id "header-wrapper"] [ - div [Id "header"] [ - h2 [Id "logo"] [!! siteInfo.title] - ] - div [Class "searchbox"] [ - label [Custom("for", "search-by")] [i [Class "fas fa-search"] []] - input [Custom ("data-search-input", ""); Id "search-by"; Type "search"; Placeholder "Search..."] - span [Custom ("data-search-clear", "")] [i [Class "fas fa-times"] []] - ] - script [Type "text/javascript"; Src (rootUrl.subRoute "/static/js/lunr.min.js")] [] - script [Type "text/javascript"; Src (rootUrl.subRoute "/static/js/auto-complete.js")] [] - script [Type "text/javascript";] [!! (sprintf "var baseurl ='%s'" (rootUrl.subRoute "")) ] - script [Type "text/javascript"; Src (rootUrl.subRoute "/static/js/search.js")] [] - ] - div [Class "highlightable"] [ - ul [Class "topics"] menuHeader - if hasExplanations then renderExpls - if hasTutorials then renderTuts - if hasHowTos then renderHowTos - renderLanguages - renderShortucuts - renderFooter - ] - ] - diff --git a/fcs/docsrc/loaders/apirefloader.fsx b/fcs/docsrc/loaders/apirefloader.fsx deleted file mode 100644 index dfc36713fb..0000000000 --- a/fcs/docsrc/loaders/apirefloader.fsx +++ /dev/null @@ -1,68 +0,0 @@ -#r "../_lib/Fornax.Core.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.MetadataFormat.dll" - -open System -open System.IO -open FSharp.MetadataFormat - -type ApiPageInfo<'a> = { - ParentName: string - ParentUrlName: string - NamespaceName: string - NamespaceUrlName: string - Info: 'a -} - -type AssemblyEntities = { - Label: string - Modules: ApiPageInfo list - Types: ApiPageInfo list - GeneratorOutput: GeneratorOutput -} - -let rec collectModules pn pu nn nu (m: Module) = - [ - yield { ParentName = pn; ParentUrlName = pu; NamespaceName = nn; NamespaceUrlName = nu; Info = m} - yield! m.NestedModules |> List.collect (collectModules m.Name m.UrlName nn nu ) - ] - - -let loader (projectRoot: string) (siteContent: SiteContents) = - let label = "FSharp.Compiler.Service" - let dll = Path.Combine(projectRoot, "..", "..", "artifacts", "bin", "fcs", "Release", "netstandard2.0", "FSharp.Compiler.Service.dll") - let libs = Path.Combine(projectRoot, "..", "..", "artifacts", "bin", "fcs", "Release", "netstandard2.0") - - if (not (File.Exists dll)) then failwithf "Unable to find FCS dll at %s" dll - - printfn "generating api ref for %s at %s" label dll - - let output = MetadataFormat.Generate(dll, markDownComments = true, publicOnly = true, libDirs = [libs]) - - let allModules = - output.AssemblyGroup.Namespaces - |> List.collect (fun n -> - List.collect (collectModules n.Name n.Name n.Name n.Name) n.Modules - ) - - let allTypes = - [ - yield! - output.AssemblyGroup.Namespaces - |> List.collect (fun n -> - n.Types |> List.map (fun t -> {ParentName = n.Name; ParentUrlName = n.Name; NamespaceName = n.Name; NamespaceUrlName = n.Name; Info = t} ) - ) - yield! - allModules - |> List.collect (fun n -> - n.Info.NestedTypes |> List.map (fun t -> {ParentName = n.Info.Name; ParentUrlName = n.Info.UrlName; NamespaceName = n.NamespaceName; NamespaceUrlName = n.NamespaceUrlName; Info = t}) ) - ] - let entities = { - Label = label - Modules = allModules - Types = allTypes - GeneratorOutput = output - } - siteContent.Add entities - printfn "generated api ref for %s at %s" label dll - - siteContent \ No newline at end of file diff --git a/fcs/docsrc/loaders/contentloader.fsx b/fcs/docsrc/loaders/contentloader.fsx deleted file mode 100644 index 07d420de89..0000000000 --- a/fcs/docsrc/loaders/contentloader.fsx +++ /dev/null @@ -1,179 +0,0 @@ -open System -#r "../_lib/Fornax.Core.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.CodeFormat.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.Markdown.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.Literate.dll" - -open FSharp.Literate -open System.IO -open FSharp.CodeFormat - -type PostConfig = { - disableLiveRefresh: bool -} - -///This is following documentation structure described here https://documentation.divio.com/ -type PostCategory = - | Tutorial - | Explanation - | HowTo - | TopLevel - | ApiRef - -with - static member Parse x = - match x with - | "tutorial" -> Tutorial - | "explanation" -> Explanation - | "how-to" -> HowTo - | "top-level" -> TopLevel - | _ -> failwith "Unsupported category" - -type Post = { - file: string - link : string - title: string - content: string - text: string - menu_order: int - hide_menu: bool - category: PostCategory - language: string option -} - -let tokenToCss (x: TokenKind) = - match x with - | TokenKind.Keyword -> "hljs-keyword" - | TokenKind.String -> "hljs-string" - | TokenKind.Comment -> "hljs-comment" - | TokenKind.Identifier -> "hljs-function" - | TokenKind.Inactive -> "" - | TokenKind.Number -> "hljs-number" - | TokenKind.Operator -> "hljs-keyword" - | TokenKind.Punctuation -> "hljs-keyword" - | TokenKind.Preprocessor -> "hljs-comment" - | TokenKind.Module -> "hljs-type" - | TokenKind.ReferenceType -> "hljs-type" - | TokenKind.ValueType -> "hljs-type" - | TokenKind.Interface -> "hljs-type" - | TokenKind.TypeArgument -> "hljs-type" - | TokenKind.Property -> "hljs-function" - | TokenKind.Enumeration -> "hljs-type" - | TokenKind.UnionCase -> "hljs-type" - | TokenKind.Function -> "hljs-function" - | TokenKind.Pattern -> "hljs-function" - | TokenKind.MutableVar -> "hljs-symbol" - | TokenKind.Disposable -> "hljs-symbol" - | TokenKind.Printf -> "hljs-regexp" - | TokenKind.Escaped -> "hljs-regexp" - | TokenKind.Default -> "" - - - - -let isSeparator (input : string) = - input.StartsWith "---" - -///`fileContent` - content of page to parse. Usually whole content of `.md` file -///returns content of config that should be used for the page -let getConfig (fileContent : string) = - let fileContent = fileContent.Split '\n' - let fileContent = fileContent |> Array.skip 1 //First line must be --- - let indexOfSeperator = fileContent |> Array.findIndex isSeparator - fileContent - |> Array.splitAt indexOfSeperator - |> fst - |> String.concat "\n" - -///`fileContent` - content of page to parse. Usually whole content of `.md` file -///returns HTML version of content of the page -let getContent (fileContent : string) (fn: string) = - let fileContent = fileContent.Split '\n' - let fileContent = fileContent |> Array.skip 1 //First line must be --- - let indexOfSeperator = fileContent |> Array.findIndex isSeparator - let _, content = fileContent |> Array.splitAt indexOfSeperator - - let content = content |> Array.skip 1 |> String.concat "\n" - let doc = Literate.ParseMarkdownFile fn - let ps = - doc.Paragraphs - |> List.skip 3 //Skip opening ---, config content, and closing --- - let doc = doc.With(paragraphs = ps) - let html = Literate.WriteHtml(doc, lineNumbers = false, tokenKindToCss = tokenToCss) - .Replace("lang=\"fsharp", "class=\"language-fsharp") - content, html - -let trimString (str : string) = - str.Trim().TrimEnd('"').TrimStart('"') - -let relative toPath fromPath = - let toUri = Uri(toPath) - let fromUri = Uri(fromPath) - toUri.MakeRelativeUri(fromUri).OriginalString - -let loadFile projectRoot n = - - let text = System.IO.File.ReadAllText n - - let config = (getConfig text).Split( '\n') |> List.ofArray - - let (text, content) = getContent text n - - let file = relative (Path.Combine(projectRoot, "content") + string Path.DirectorySeparatorChar) n - let link = Path.ChangeExtension(file, ".html") - - let title = config |> List.find (fun n -> n.ToLower().StartsWith "title" ) |> fun n -> n.Split(':').[1] |> trimString - - let menu_order = - try - let n = config |> List.find (fun n -> n.ToLower().StartsWith "menu_order" ) - n.Split(':').[1] |> trimString |> System.Int32.Parse - with - | _ -> 10 - - let hide = - try - let n = config |> List.find (fun n -> n.ToLower().StartsWith "hide_menu" ) - n.Split(':').[1] |> trimString |> System.Boolean.Parse - with - | _ -> false - - let category = - let n = config |> List.find (fun n -> n.ToLower().StartsWith "category" ) - n.Split(':').[1] |> trimString |> PostCategory.Parse - - let language = - try - let n = config |> List.find (fun n -> n.ToLower().StartsWith "language" ) - n.Split(':').[1] |> trimString |> Some - with - | _ -> None - - printfn "read markdown file %s" n - - { file = file - link = link - title = title - content = content - menu_order = menu_order - hide_menu = hide - text = text - category = category - language = language } - -let loader (projectRoot: string) (siteContent: SiteContents) = - try - let postsPath = System.IO.Path.Combine(projectRoot, "content") - - Directory.GetFiles(postsPath, "*", SearchOption.AllDirectories ) - |> Array.filter (fun n -> n.EndsWith ".md") - |> Array.Parallel.map (loadFile projectRoot) - |> Array.iter siteContent.Add - - siteContent.Add {disableLiveRefresh = true} - with - | ex -> - printfn "EX: %A" ex - - siteContent - diff --git a/fcs/docsrc/loaders/copyloader.fsx b/fcs/docsrc/loaders/copyloader.fsx deleted file mode 100644 index 5ae6ba1138..0000000000 --- a/fcs/docsrc/loaders/copyloader.fsx +++ /dev/null @@ -1,18 +0,0 @@ -#r "../_lib/Fornax.Core.dll" - -open System.IO - - -let loader (projectRoot: string) (siteContent: SiteContents) = - let intputPath = Path.Combine(projectRoot, "static") - let outputPath = Path.Combine(projectRoot, "_public", "static") - if Directory.Exists outputPath then Directory.Delete(outputPath, true) - Directory.CreateDirectory outputPath |> ignore - - for dirPath in Directory.GetDirectories(intputPath, "*", SearchOption.AllDirectories) do - Directory.CreateDirectory(dirPath.Replace(intputPath, outputPath)) |> ignore - - for filePath in Directory.GetFiles(intputPath, "*.*", SearchOption.AllDirectories) do - File.Copy(filePath, filePath.Replace(intputPath, outputPath), true) - - siteContent \ No newline at end of file diff --git a/fcs/docsrc/loaders/globalloader.fsx b/fcs/docsrc/loaders/globalloader.fsx deleted file mode 100644 index 0324f077ee..0000000000 --- a/fcs/docsrc/loaders/globalloader.fsx +++ /dev/null @@ -1,37 +0,0 @@ -#r "../_lib/Fornax.Core.dll" - -type UrlRoot = | Root of string -with - member x.subRoute (route: string) = - let (Root root) = x - root.TrimEnd('/') + "/" + route.TrimStart('/') - member x.subRoutef pattern = - Printf.kprintf x.subRoute pattern - -type Theme = -| Blue -| Green -| Red - -type SiteInfo = { - title: string - description: string - theme_variant: Theme - root_url: UrlRoot -} - -let config = { - title = "FSharp Compiler Service" - description = "F# compiler services for creating IDE tools, language extensions and for F# embedding" - theme_variant = Theme.Blue - root_url = - #if WATCH - Root "//localhost:8080" - #else - Root "//fsharp.github.io/FSharp.Compiler.Service" - #endif -} - -let loader (projectRoot: string) (siteContent: SiteContents) = - siteContent.Add(config) - siteContent diff --git a/fcs/docsrc/loaders/literateloader.fsx b/fcs/docsrc/loaders/literateloader.fsx deleted file mode 100644 index 614c6c99ff..0000000000 --- a/fcs/docsrc/loaders/literateloader.fsx +++ /dev/null @@ -1,147 +0,0 @@ -open System -#r "../_lib/Fornax.Core.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.CodeFormat.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.Markdown.dll" -#r "../../packages/docs/FSharp.Formatting/lib/netstandard2.0/FSharp.Literate.dll" - -#if !FORNAX -#load "./contentloader.fsx" -open Contentloader -#endif - -open System.IO -open FSharp.Literate -open FSharp.CodeFormat - -let tokenToCss (x: TokenKind) = - match x with - | TokenKind.Keyword -> "hljs-keyword" - | TokenKind.String -> "hljs-string" - | TokenKind.Comment -> "hljs-comment" - | TokenKind.Identifier -> "hljs-function" - | TokenKind.Inactive -> "" - | TokenKind.Number -> "hljs-number" - | TokenKind.Operator -> "hljs-keyword" - | TokenKind.Punctuation -> "hljs-keyword" - | TokenKind.Preprocessor -> "hljs-comment" - | TokenKind.Module -> "hljs-type" - | TokenKind.ReferenceType -> "hljs-type" - | TokenKind.ValueType -> "hljs-type" - | TokenKind.Interface -> "hljs-type" - | TokenKind.TypeArgument -> "hljs-type" - | TokenKind.Property -> "hljs-function" - | TokenKind.Enumeration -> "hljs-type" - | TokenKind.UnionCase -> "hljs-type" - | TokenKind.Function -> "hljs-function" - | TokenKind.Pattern -> "hljs-function" - | TokenKind.MutableVar -> "hljs-symbol" - | TokenKind.Disposable -> "hljs-symbol" - | TokenKind.Printf -> "hljs-regexp" - | TokenKind.Escaped -> "hljs-regexp" - | TokenKind.Default -> "" - -let isSeparator (input : string) = - input.StartsWith "---" - - -///`fileContent` - content of page to parse. Usually whole content of `.md` file -///returns content of config that should be used for the page -let getConfig' (fileContent : string) = - let fileContent = fileContent.Split '\n' - let fileContent = fileContent |> Array.skip 2 //First line must be (*, second line must be --- - let indexOfSeperator = (fileContent |> Array.findIndex isSeparator) + 1 - fileContent - |> Array.splitAt indexOfSeperator - |> fst - |> String.concat "\n" - -///`fileContent` - content of page to parse. Usually whole content of `.fsx` file -///returns HTML version of content of the page -let getContent' (fileContent : string) (fn: string) = - let fileContent = fileContent.Split '\n' - let fileContent = fileContent |> Array.skip 2 //First line must be (*, second line must be --- - let indexOfSeperator = (fileContent |> Array.findIndex isSeparator) + 1 - let _, content = fileContent |> Array.splitAt indexOfSeperator - - let content = content |> Array.skip 1 |> String.concat "\n" - let doc = Literate.ParseScriptFile fn - let ps = - doc.Paragraphs - |> List.skip 3 //Skip opening ---, config content, and closing --- - let doc = doc.With(paragraphs = ps) - let html = Literate.WriteHtml(doc, lineNumbers = false, tokenKindToCss = tokenToCss) - .Replace("lang=\"fsharp", "class=\"language-fsharp") - content, html - - -let trimString (str : string) = - str.Trim().TrimEnd('"').TrimStart('"') - -let relative toPath fromPath = - let toUri = Uri(toPath) - let fromUri = Uri(fromPath) - toUri.MakeRelativeUri(fromUri).OriginalString - -let loadFile projectRoot n = - let text = System.IO.File.ReadAllText n - - let config = (getConfig' text).Split( '\n') |> List.ofArray - - let (text, content) = getContent' text n - - let file = relative (Path.Combine(projectRoot, "content") + string Path.DirectorySeparatorChar) n - let link = Path.ChangeExtension(file, ".html") - - let title = config |> List.find (fun n -> n.ToLower().StartsWith "title" ) |> fun n -> n.Split(':').[1] |> trimString - - let menu_order = - try - let n = config |> List.find (fun n -> n.ToLower().StartsWith "menu_order" ) - n.Split(':').[1] |> trimString |> System.Int32.Parse - with - | _ -> 10 - - let hide = - try - let n = config |> List.find (fun n -> n.ToLower().StartsWith "hide_menu" ) - n.Split(':').[1] |> trimString |> System.Boolean.Parse - with - | _ -> false - - let category = - let n = config |> List.find (fun n -> n.ToLower().StartsWith "category" ) - n.Split(':').[1] |> trimString |> PostCategory.Parse - - let language = - try - let n = config |> List.find (fun n -> n.ToLower().StartsWith "language" ) - n.Split(':').[1] |> trimString |> Some - with - | _ -> None - - printfn "read literate file %s" n - - { file = file - link = link - title = title - content = content - menu_order = menu_order - hide_menu = hide - text = text - category = category - language = language } - -let loader (projectRoot: string) (siteContent: SiteContents) = - try - let postsPath = System.IO.Path.Combine(projectRoot, "content") - Directory.GetFiles(postsPath, "*", SearchOption.AllDirectories ) - |> Array.filter (fun n -> n.EndsWith ".fsx") - |> Array.Parallel.map (loadFile projectRoot) - |> Array.iter siteContent.Add - - siteContent.Add {disableLiveRefresh = true} - with - | ex -> printfn "EX: %A" ex - - siteContent - diff --git a/fcs/docsrc/loaders/pageloader.fsx b/fcs/docsrc/loaders/pageloader.fsx deleted file mode 100644 index 0d49932a52..0000000000 --- a/fcs/docsrc/loaders/pageloader.fsx +++ /dev/null @@ -1,16 +0,0 @@ -#r "../_lib/Fornax.Core.dll" - - -type Shortcut = { - title: string - link: string - icon: string -} - -let loader (projectRoot: string) (siteContent: SiteContents) = - siteContent.Add({title = "Home"; link = "/"; icon = "fas fa-home"}) - siteContent.Add({title = "F# Software Foundation"; link = "https://fsharp.org"; icon = "fas fa-globe"}) - siteContent.Add({title = "GitHub repo"; link = "https://github.com/fsharp/FSharp.Compiler.Service"; icon = "fab fa-github"}) - siteContent.Add({title = "License"; link = "https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE"; icon = "far fa-file"}) - siteContent.Add({title = "Release Notes"; link = "https://github.com/fsharp/FSharp.Compiler.Service/blob/master/RELEASE_NOTES.md"; icon = "far fa-file-alt"}) - siteContent \ No newline at end of file diff --git a/fcs/docsrc/static/css/atom-one-dark-reasonable.css b/fcs/docsrc/static/css/atom-one-dark-reasonable.css deleted file mode 100644 index fd41c996a3..0000000000 --- a/fcs/docsrc/static/css/atom-one-dark-reasonable.css +++ /dev/null @@ -1,77 +0,0 @@ -/* - -Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage - -Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax - -*/ -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - line-height: 1.3em; - color: #abb2bf; - background: #282c34; - border-radius: 5px; -} -.hljs-keyword, .hljs-operator { - color: #F92672; -} -.hljs-pattern-match { - color: #F92672; -} -.hljs-pattern-match .hljs-constructor { - color: #61aeee; -} -.hljs-function { - color: #61aeee; -} -.hljs-function .hljs-params { - color: #A6E22E; -} -.hljs-function .hljs-params .hljs-typing { - color: #FD971F; -} -.hljs-module-access .hljs-module { - color: #7e57c2; -} -.hljs-constructor { - color: #e2b93d; -} -.hljs-constructor .hljs-string { - color: #9CCC65; -} -.hljs-comment, .hljs-quote { - color: #b18eb1; - font-style: italic; -} -.hljs-doctag, .hljs-formula { - color: #c678dd; -} -.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { - color: #e06c75; -} -.hljs-literal { - color: #56b6c2; -} -.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { - color: #98c379; -} -.hljs-built_in, .hljs-class .hljs-title { - color: #e6c07b; -} -.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { - color: #d19a66; -} -.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { - color: #61aeee; -} -.hljs-emphasis { - font-style: italic; -} -.hljs-strong { - font-weight: bold; -} -.hljs-link { - text-decoration: underline; -} diff --git a/fcs/docsrc/static/css/auto-complete.css b/fcs/docsrc/static/css/auto-complete.css deleted file mode 100644 index ac6979ad36..0000000000 --- a/fcs/docsrc/static/css/auto-complete.css +++ /dev/null @@ -1,47 +0,0 @@ -.autocomplete-suggestions { - text-align: left; - cursor: default; - border: 1px solid #ccc; - border-top: 0; - background: #fff; - box-shadow: -1px 1px 3px rgba(0,0,0,.1); - - /* core styles should not be changed */ - position: absolute; - display: none; - z-index: 9999; - max-height: 254px; - overflow: hidden; - overflow-y: auto; - box-sizing: border-box; - -} -.autocomplete-suggestion { - position: relative; - cursor: pointer; - padding: 7px; - line-height: 23px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: #333; -} - -.autocomplete-suggestion b { - font-weight: normal; - color: #1f8dd6; -} - -.autocomplete-suggestion.selected { - background: #333; - color: #fff; -} - -.autocomplete-suggestion:hover { - background: #444; - color: #fff; -} - -.autocomplete-suggestion > .context { - font-size: 12px; -} diff --git a/fcs/docsrc/static/css/custom.css b/fcs/docsrc/static/css/custom.css deleted file mode 100644 index a03e1237c8..0000000000 --- a/fcs/docsrc/static/css/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -:root #header + #content > #left > #rlblock_left{ - display:none !important; -} \ No newline at end of file diff --git a/fcs/docsrc/static/css/featherlight.min.css b/fcs/docsrc/static/css/featherlight.min.css deleted file mode 100644 index 058487f916..0000000000 --- a/fcs/docsrc/static/css/featherlight.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Featherlight - ultra slim jQuery lightbox - * Version 1.7.13 - http://noelboss.github.io/featherlight/ - * - * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com) - * MIT Licensed. -**/ -html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}} \ No newline at end of file diff --git a/fcs/docsrc/static/css/fontawesome-all.min.css b/fcs/docsrc/static/css/fontawesome-all.min.css deleted file mode 100644 index de56473722..0000000000 --- a/fcs/docsrc/static/css/fontawesome-all.min.css +++ /dev/null @@ -1 +0,0 @@ -.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s infinite linear}.fa-pulse{animation:fa-spin 1s infinite steps(8)}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hashtag:before{content:"\f292"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-icicles:before{content:"\f7ad"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-nintendo-switch:before{content:"\f418"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-volume:before{content:"\f2a0"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:normal;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900} \ No newline at end of file diff --git a/fcs/docsrc/static/css/hugo-theme.css b/fcs/docsrc/static/css/hugo-theme.css deleted file mode 100644 index 741cab196a..0000000000 --- a/fcs/docsrc/static/css/hugo-theme.css +++ /dev/null @@ -1,254 +0,0 @@ -/* Insert here special css for hugo theme, on top of any other imported css */ - - -/* Table of contents */ - -.progress ul { - list-style: none; - margin: 0; - padding: 0 5px; -} - -#TableOfContents { - font-size: 13px !important; - max-height: 85vh; - overflow: auto; - padding: 15px !important; -} - - -#TableOfContents > ul > li > ul > li > ul li { - margin-right: 8px; -} - -#TableOfContents > ul > li > a { - font-weight: bold; padding: 0 18px; margin: 0 2px; -} - -#TableOfContents > ul > li > ul > li > a { - font-weight: bold; -} - -#TableOfContents > ul > li > ul > li > ul > li > ul > li > ul > li { - display: none; -} - -body { - font-size: 16px !important; - color: #323232 !important; -} - -#body a.highlight, #body a.highlight:hover, #body a.highlight:focus { - text-decoration: none; - outline: none; - outline: 0; -} -#body a.highlight { - line-height: 1.1; - display: inline-block; -} -#body a.highlight:after { - display: block; - content: ""; - height: 1px; - width: 0%; - background-color: #0082a7; /*#CE3B2F*/ - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -ms-transition: width 0.5s ease; - transition: width 0.5s ease; -} -#body a.highlight:hover:after, #body a.highlight:focus:after { - width: 100%; -} -.progress { - position:absolute; - background-color: rgba(246, 246, 246, 0.97); - width: auto; - border: thin solid #ECECEC; - display:none; - z-index:200; -} - -#toc-menu { - border-right: thin solid #DAD8D8 !important; - padding-right: 1rem !important; - margin-right: 0.5rem !important; -} - -#sidebar-toggle-span { - border-right: thin solid #DAD8D8 !important; - padding-right: 0.5rem !important; - margin-right: 1rem !important; -} - -.btn { - display: inline-block !important; - padding: 6px 12px !important; - margin-bottom: 0 !important; - font-size: 14px !important; - font-weight: normal !important; - line-height: 1.42857143 !important; - text-align: center !important; - white-space: nowrap !important; - vertical-align: middle !important; - -ms-touch-action: manipulation !important; - touch-action: manipulation !important; - cursor: pointer !important; - -webkit-user-select: none !important; - -moz-user-select: none !important; - -ms-user-select: none !important; - user-select: none !important; - background-image: none !important; - border: 1px solid transparent !important; - border-radius: 4px !important; - -webkit-transition: all 0.15s !important; - -moz-transition: all 0.15s !important; - transition: all 0.15s !important; -} -.btn:focus { - /*outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px;*/ - outline: none !important; -} -.btn:hover, -.btn:focus { - color: #2b2b2b !important; - text-decoration: none !important; -} - -.btn-default { - color: #333 !important; - background-color: #fff !important; - border-color: #ccc !important; -} -.btn-default:hover, -.btn-default:focus, -.btn-default:active { - color: #fff !important; - background-color: #9e9e9e !important; - border-color: #9e9e9e !important; -} -.btn-default:active { - background-image: none !important; -} - -/* anchors */ -.anchor { - color: #00bdf3; - font-size: 0.5em; - cursor:pointer; - visibility:hidden; - margin-left: 0.5em; - position: absolute; - margin-top:0.1em; -} - -h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { - visibility:visible; -} - -/* Redfines headers style */ - -h2, h3, h4, h5, h6 { - font-weight: 400; - line-height: 1.1; -} - -h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { - font-weight: inherit; -} - -h2 { - font-size: 2.5rem; - line-height: 110% !important; - margin: 2.5rem 0 1.5rem 0; -} - -h3 { - font-size: 2rem; - line-height: 110% !important; - margin: 2rem 0 1rem 0; -} - -h4 { - font-size: 1.5rem; - line-height: 110% !important; - margin: 1.5rem 0 0.75rem 0; -} - -h5 { - font-size: 1rem; - line-height: 110% !important; - margin: 1rem 0 0.2rem 0; -} - -h6 { - font-size: 0.5rem; - line-height: 110% !important; - margin: 0.5rem 0 0.2rem 0; -} - -p { - margin: 1rem 0; -} - -figcaption h4 { - font-weight: 300 !important; - opacity: .85; - font-size: 1em; - text-align: center; - margin-top: -1.5em; -} - -.select-style { - border: 0; - width: 150px; - border-radius: 0px; - overflow: hidden; - display: inline-flex; -} - -.select-style svg { - fill: #ccc; - width: 14px; - height: 14px; - pointer-events: none; - margin: auto; -} - -.select-style svg:hover { - fill: #e6e6e6; -} - -.select-style select { - padding: 0; - width: 130%; - border: none; - box-shadow: none; - background: transparent; - background-image: none; - -webkit-appearance: none; - margin: auto; - margin-left: 0px; - margin-right: -20px; -} - -.select-style select:focus { - outline: none; -} - -.select-style :hover { - cursor: pointer; -} - -@media only all and (max-width: 47.938em) { - #breadcrumbs .links, #top-github-link-text { - display: none; - } -} - -.is-sticky #top-bar { - box-shadow: -1px 2px 5px 1px rgba(0, 0, 0, 0.1); -} \ No newline at end of file diff --git a/fcs/docsrc/static/css/hybrid.css b/fcs/docsrc/static/css/hybrid.css deleted file mode 100644 index 29735a1890..0000000000 --- a/fcs/docsrc/static/css/hybrid.css +++ /dev/null @@ -1,102 +0,0 @@ -/* - -vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) - -*/ - -/*background color*/ -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #1d1f21; -} - -/*selection color*/ -.hljs::selection, -.hljs span::selection { - background: #373b41; -} - -.hljs::-moz-selection, -.hljs span::-moz-selection { - background: #373b41; -} - -/*foreground color*/ -.hljs { - color: #c5c8c6; -} - -/*color: fg_yellow*/ -.hljs-title, -.hljs-name { - color: #f0c674; -} - -/*color: fg_comment*/ -.hljs-comment, -.hljs-meta, -.hljs-meta .hljs-keyword { - color: #707880; -} - -/*color: fg_red*/ -.hljs-number, -.hljs-symbol, -.hljs-literal, -.hljs-deletion, -.hljs-link { - color: #cc6666 -} - -/*color: fg_green*/ -.hljs-string, -.hljs-doctag, -.hljs-addition, -.hljs-regexp, -.hljs-selector-attr, -.hljs-selector-pseudo { - color: #b5bd68; -} - -/*color: fg_purple*/ -.hljs-attribute, -.hljs-code, -.hljs-selector-id { - color: #b294bb; -} - -/*color: fg_blue*/ -.hljs-keyword, -.hljs-selector-tag, -.hljs-bullet, -.hljs-tag { - color: #81a2be; -} - -/*color: fg_aqua*/ -.hljs-subst, -.hljs-variable, -.hljs-template-tag, -.hljs-template-variable { - color: #8abeb7; -} - -/*color: fg_orange*/ -.hljs-type, -.hljs-built_in, -.hljs-builtin-name, -.hljs-quote, -.hljs-section, -.hljs-selector-class { - color: #de935f; -} - -.hljs-emphasis { - font-style: italic; -} - -.hljs-strong { - font-weight: bold; -} diff --git a/fcs/docsrc/static/css/nucleus.css b/fcs/docsrc/static/css/nucleus.css deleted file mode 100644 index 1897fc5d6d..0000000000 --- a/fcs/docsrc/static/css/nucleus.css +++ /dev/null @@ -1,615 +0,0 @@ -*, *::before, *::after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - -@-webkit-viewport { - width: device-width; } -@-moz-viewport { - width: device-width; } -@-ms-viewport { - width: device-width; } -@-o-viewport { - width: device-width; } -@viewport { - width: device-width; } -html { - font-size: 100%; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; } - -body { - margin: 0; } - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -nav, -section, -summary { - display: block; } - -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; } - -audio:not([controls]) { - display: none; - height: 0; } - -[hidden], -template { - display: none; } - -a { - background: transparent; - text-decoration: none; } - -a:active, -a:hover { - outline: 0; } - -abbr[title] { - border-bottom: 1px dotted; } - -b, -strong { - font-weight: bold; } - -dfn { - font-style: italic; } - -mark { - background: #FFFF27; - color: #333; } - -sub, -sup { - font-size: 0.8rem; - line-height: 0; - position: relative; - vertical-align: baseline; } - -sup { - top: -0.5em; } - -sub { - bottom: -0.25em; } - -img { - border: 0; - max-width: 100%; } - -svg:not(:root) { - overflow: hidden; } - -figure { - margin: 1em 40px; } - -hr { - height: 0; } - -pre { - overflow: auto; } - -button, -input, -optgroup, -select, -textarea { - color: inherit; - font: inherit; - margin: 0; } - -button { - overflow: visible; } - -button, -select { - text-transform: none; } - -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; } - -button[disabled], -html input[disabled] { - cursor: default; } - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; } - -input { - line-height: normal; } - -input[type="checkbox"], -input[type="radio"] { - padding: 0; } - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; } - -input[type="search"] { - -webkit-appearance: textfield; } - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; } - -legend { - border: 0; - padding: 0; } - -textarea { - overflow: auto; } - -optgroup { - font-weight: bold; } - -table { - border-collapse: collapse; - border-spacing: 0; - table-layout: fixed; - width: 100%; } - -tr, td, th { - vertical-align: middle; } - -th, td { - padding: 0.425rem 0; } - -th { - text-align: left; } - -.container { - width: 75em; - margin: 0 auto; - padding: 0; } - @media only all and (min-width: 60em) and (max-width: 74.938em) { - .container { - width: 60em; } } - @media only all and (min-width: 48em) and (max-width: 59.938em) { - .container { - width: 48em; } } - @media only all and (min-width: 30.063em) and (max-width: 47.938em) { - .container { - width: 30em; } } - @media only all and (max-width: 30em) { - .container { - width: 100%; } } - -.grid { - display: -webkit-box; - display: -moz-box; - display: box; - display: -webkit-flex; - display: -moz-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: row; - -moz-flex-flow: row; - flex-flow: row; - list-style: none; - margin: 0; - padding: 0; } - @media only all and (max-width: 47.938em) { - .grid { - -webkit-flex-flow: row wrap; - -moz-flex-flow: row wrap; - flex-flow: row wrap; } } - -.block { - -webkit-box-flex: 1; - -moz-box-flex: 1; - box-flex: 1; - -webkit-flex: 1; - -moz-flex: 1; - -ms-flex: 1; - flex: 1; - min-width: 0; - min-height: 0; } - @media only all and (max-width: 47.938em) { - .block { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 100%; - -moz-flex: 0 100%; - -ms-flex: 0 100%; - flex: 0 100%; } } - -.content { - margin: 0.625rem; - padding: 0.938rem; } - -@media only all and (max-width: 47.938em) { - body [class*="size-"] { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 100%; - -moz-flex: 0 100%; - -ms-flex: 0 100%; - flex: 0 100%; } } - -.size-1-2 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 50%; - -moz-flex: 0 50%; - -ms-flex: 0 50%; - flex: 0 50%; } - -.size-1-3 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 33.33333%; - -moz-flex: 0 33.33333%; - -ms-flex: 0 33.33333%; - flex: 0 33.33333%; } - -.size-1-4 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 25%; - -moz-flex: 0 25%; - -ms-flex: 0 25%; - flex: 0 25%; } - -.size-1-5 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 20%; - -moz-flex: 0 20%; - -ms-flex: 0 20%; - flex: 0 20%; } - -.size-1-6 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 16.66667%; - -moz-flex: 0 16.66667%; - -ms-flex: 0 16.66667%; - flex: 0 16.66667%; } - -.size-1-7 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 14.28571%; - -moz-flex: 0 14.28571%; - -ms-flex: 0 14.28571%; - flex: 0 14.28571%; } - -.size-1-8 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 12.5%; - -moz-flex: 0 12.5%; - -ms-flex: 0 12.5%; - flex: 0 12.5%; } - -.size-1-9 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 11.11111%; - -moz-flex: 0 11.11111%; - -ms-flex: 0 11.11111%; - flex: 0 11.11111%; } - -.size-1-10 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 10%; - -moz-flex: 0 10%; - -ms-flex: 0 10%; - flex: 0 10%; } - -.size-1-11 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 9.09091%; - -moz-flex: 0 9.09091%; - -ms-flex: 0 9.09091%; - flex: 0 9.09091%; } - -.size-1-12 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 8.33333%; - -moz-flex: 0 8.33333%; - -ms-flex: 0 8.33333%; - flex: 0 8.33333%; } - -@media only all and (min-width: 48em) and (max-width: 59.938em) { - .size-tablet-1-2 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 50%; - -moz-flex: 0 50%; - -ms-flex: 0 50%; - flex: 0 50%; } - - .size-tablet-1-3 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 33.33333%; - -moz-flex: 0 33.33333%; - -ms-flex: 0 33.33333%; - flex: 0 33.33333%; } - - .size-tablet-1-4 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 25%; - -moz-flex: 0 25%; - -ms-flex: 0 25%; - flex: 0 25%; } - - .size-tablet-1-5 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 20%; - -moz-flex: 0 20%; - -ms-flex: 0 20%; - flex: 0 20%; } - - .size-tablet-1-6 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 16.66667%; - -moz-flex: 0 16.66667%; - -ms-flex: 0 16.66667%; - flex: 0 16.66667%; } - - .size-tablet-1-7 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 14.28571%; - -moz-flex: 0 14.28571%; - -ms-flex: 0 14.28571%; - flex: 0 14.28571%; } - - .size-tablet-1-8 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 12.5%; - -moz-flex: 0 12.5%; - -ms-flex: 0 12.5%; - flex: 0 12.5%; } - - .size-tablet-1-9 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 11.11111%; - -moz-flex: 0 11.11111%; - -ms-flex: 0 11.11111%; - flex: 0 11.11111%; } - - .size-tablet-1-10 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 10%; - -moz-flex: 0 10%; - -ms-flex: 0 10%; - flex: 0 10%; } - - .size-tablet-1-11 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 9.09091%; - -moz-flex: 0 9.09091%; - -ms-flex: 0 9.09091%; - flex: 0 9.09091%; } - - .size-tablet-1-12 { - -webkit-box-flex: 0; - -moz-box-flex: 0; - box-flex: 0; - -webkit-flex: 0 8.33333%; - -moz-flex: 0 8.33333%; - -ms-flex: 0 8.33333%; - flex: 0 8.33333%; } } -@media only all and (max-width: 47.938em) { - @supports not (flex-wrap: wrap) { - .grid { - display: block; - -webkit-box-lines: inherit; - -moz-box-lines: inherit; - box-lines: inherit; - -webkit-flex-wrap: inherit; - -moz-flex-wrap: inherit; - -ms-flex-wrap: inherit; - flex-wrap: inherit; } - - .block { - display: block; - -webkit-box-flex: inherit; - -moz-box-flex: inherit; - box-flex: inherit; - -webkit-flex: inherit; - -moz-flex: inherit; - -ms-flex: inherit; - flex: inherit; } } } -.first-block { - -webkit-box-ordinal-group: 0; - -webkit-order: -1; - -ms-flex-order: -1; - order: -1; } - -.last-block { - -webkit-box-ordinal-group: 2; - -webkit-order: 1; - -ms-flex-order: 1; - order: 1; } - -.fixed-blocks { - -webkit-flex-flow: row wrap; - -moz-flex-flow: row wrap; - flex-flow: row wrap; } - .fixed-blocks .block { - -webkit-box-flex: inherit; - -moz-box-flex: inherit; - box-flex: inherit; - -webkit-flex: inherit; - -moz-flex: inherit; - -ms-flex: inherit; - flex: inherit; - width: 25%; } - @media only all and (min-width: 60em) and (max-width: 74.938em) { - .fixed-blocks .block { - width: 33.33333%; } } - @media only all and (min-width: 48em) and (max-width: 59.938em) { - .fixed-blocks .block { - width: 50%; } } - @media only all and (max-width: 47.938em) { - .fixed-blocks .block { - width: 100%; } } - -body { - font-size: 1.05rem; - line-height: 1.7; } - -h1, h2, h3, h4, h5, h6 { - margin: 0.85rem 0 1.7rem 0; - text-rendering: optimizeLegibility; } - -h1 { - font-size: 3.25rem; } - -h2 { - font-size: 2.55rem; } - -h3 { - font-size: 2.15rem; } - -h4 { - font-size: 1.8rem; } - -h5 { - font-size: 1.4rem; } - -h6 { - font-size: 0.9rem; } - -p { - margin: 1.7rem 0; } - -ul, ol { - margin-top: 1.7rem; - margin-bottom: 1.7rem; } - ul ul, ul ol, ol ul, ol ol { - margin-top: 0; - margin-bottom: 0; } - -blockquote { - margin: 1.7rem 0; - padding-left: 0.85rem; } - -cite { - display: block; - font-size: 0.925rem; } - cite:before { - content: "\2014 \0020"; } - -pre { - margin: 1.7rem 0; - padding: 0.938rem; } - -code { - vertical-align: bottom; } - -small { - font-size: 0.925rem; } - -hr { - border-left: none; - border-right: none; - border-top: none; - margin: 1.7rem 0; } - -fieldset { - border: 0; - padding: 0.938rem; - margin: 0 0 1.7rem 0; } - -input, -label, -select { - display: block; } - -label { - margin-bottom: 0.425rem; } - label.required:after { - content: "*"; } - label abbr { - display: none; } - -textarea, input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], select[multiple=multiple] { - -webkit-transition: border-color; - -moz-transition: border-color; - transition: border-color; - border-radius: 0.1875rem; - margin-bottom: 0.85rem; - padding: 0.425rem 0.425rem; - width: 100%; } - textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { - outline: none; } - -textarea { - resize: vertical; } - -input[type="checkbox"], input[type="radio"] { - display: inline; - margin-right: 0.425rem; } - -input[type="file"] { - width: 100%; } - -select { - width: auto; - max-width: 100%; - margin-bottom: 1.7rem; } - -button, -input[type="submit"] { - cursor: pointer; - user-select: none; - vertical-align: middle; - white-space: nowrap; - border: inherit; } diff --git a/fcs/docsrc/static/css/perfect-scrollbar.min.css b/fcs/docsrc/static/css/perfect-scrollbar.min.css deleted file mode 100644 index ebd2cb43bc..0000000000 --- a/fcs/docsrc/static/css/perfect-scrollbar.min.css +++ /dev/null @@ -1,2 +0,0 @@ -/* perfect-scrollbar v0.6.13 */ -.ps-container{-ms-touch-action:auto;touch-action:auto;overflow:hidden !important;-ms-overflow-style:none}@supports (-ms-overflow-style: none){.ps-container{overflow:auto !important}}@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none){.ps-container{overflow:auto !important}}.ps-container.ps-active-x>.ps-scrollbar-x-rail,.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block;background-color:transparent}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999;height:11px}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999;width:11px}.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;bottom:0px;height:15px}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;-o-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;-moz-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;bottom:2px;height:6px}.ps-container>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x,.ps-container>.ps-scrollbar-x-rail:active>.ps-scrollbar-x{height:11px}.ps-container>.ps-scrollbar-y-rail{display:none;position:absolute;opacity:0;-webkit-transition:background-color .2s linear, opacity .2s linear;-o-transition:background-color .2s linear, opacity .2s linear;-moz-transition:background-color .2s linear, opacity .2s linear;transition:background-color .2s linear, opacity .2s linear;right:0;width:15px}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;background-color:#aaa;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;-o-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;-moz-transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;transition:background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;right:2px;width:6px}.ps-container>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y,.ps-container>.ps-scrollbar-y-rail:active>.ps-scrollbar-y{width:11px}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999;height:11px}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999;width:11px}.ps-container:hover>.ps-scrollbar-x-rail,.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6}.ps-container:hover>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container:hover>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999} diff --git a/fcs/docsrc/static/css/tags.css b/fcs/docsrc/static/css/tags.css deleted file mode 100644 index 495d2f9f71..0000000000 --- a/fcs/docsrc/static/css/tags.css +++ /dev/null @@ -1,49 +0,0 @@ -/* Tags */ - -#head-tags{ - margin-left:1em; - margin-top:1em; -} - -#body .tags a.tag-link { - display: inline-block; - line-height: 2em; - font-size: 0.8em; - position: relative; - margin: 0 16px 8px 0; - padding: 0 10px 0 12px; - background: #8451a1; - - -webkit-border-bottom-right-radius: 3px; - border-bottom-right-radius: 3px; - -webkit-border-top-right-radius: 3px; - border-top-right-radius: 3px; - - -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.2); - box-shadow: 0 1px 2px rgba(0,0,0,0.2); - color: #fff; -} - -#body .tags a.tag-link:before { - content: ""; - position: absolute; - top:0; - left: -1em; - width: 0; - height: 0; - border-color: transparent #8451a1 transparent transparent; - border-style: solid; - border-width: 1em 1em 1em 0; -} - -#body .tags a.tag-link:after { - content: ""; - position: absolute; - top: 10px; - left: 1px; - width: 5px; - height: 5px; - -webkit-border-radius: 50%; - border-radius: 100%; - background: #fff; -} diff --git a/fcs/docsrc/static/css/theme-blue.css b/fcs/docsrc/static/css/theme-blue.css deleted file mode 100644 index 9771ae5e3a..0000000000 --- a/fcs/docsrc/static/css/theme-blue.css +++ /dev/null @@ -1,111 +0,0 @@ - -:root{ - - --MAIN-TEXT-color:#323232; /* Color of text by default */ - --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */ - --MAIN-LINK-color:#1C90F3; /* Color of links */ - --MAIN-LINK-HOVER-color:#167ad0; /* Color of hovered links */ - --MAIN-ANCHOR-color: #1C90F3; /* color of anchors on titles */ - - --MENU-HEADER-BG-color:#1C90F3; /* Background color of menu header */ - --MENU-HEADER-BORDER-color:#33a1ff; /*Color of menu header border */ - - --MENU-SEARCH-BG-color:#167ad0; /* Search field background color (by default borders + icons) */ - --MENU-SEARCH-BOX-color: #33a1ff; /* Override search field border color */ - --MENU-SEARCH-BOX-ICONS-color: #a1d2fd; /* Override search field icons color */ - - --MENU-SECTIONS-ACTIVE-BG-color:#20272b; /* Background color of the active section and its childs */ - --MENU-SECTIONS-BG-color:#252c31; /* Background color of other sections */ - --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ - --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ - --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */ - --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */ - - --MENU-VISITED-color: #33a1ff; /* Color of 'page visited' icons in menu */ - --MENU-SECTION-HR-color: #20272b; /* Color of


separator in menu */ - -} - -body { - color: var(--MAIN-TEXT-color) !important; -} - -textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { - border-color: none; - box-shadow: none; -} - -h2, h3, h4, h5 { - color: var(--MAIN-TITLES-TEXT-color) !important; -} - -a { - color: var(--MAIN-LINK-color); -} - -.anchor { - color: var(--MAIN-ANCHOR-color); -} - -a:hover { - color: var(--MAIN-LINK-HOVER-color); -} - -#sidebar ul li.visited > a .read-icon { - color: var(--MENU-VISITED-color); -} - -#body a.highlight:after { - display: block; - content: ""; - height: 1px; - width: 0%; - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -ms-transition: width 0.5s ease; - transition: width 0.5s ease; - background-color: var(--MAIN-LINK-HOVER-color); -} -#sidebar { - background-color: var(--MENU-SECTIONS-BG-color); -} -#sidebar #header-wrapper { - background: var(--MENU-HEADER-BG-color); - color: var(--MENU-SEARCH-BOX-color); - border-color: var(--MENU-HEADER-BORDER-color); -} -#sidebar .searchbox { - border-color: var(--MENU-SEARCH-BOX-color); - background: var(--MENU-SEARCH-BG-color); -} -#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { - background: var(--MENU-SECTIONS-ACTIVE-BG-color); -} -#sidebar .searchbox * { - color: var(--MENU-SEARCH-BOX-ICONS-color); -} - -#sidebar a { - color: var(--MENU-SECTIONS-LINK-color); -} - -#sidebar a:hover { - color: var(--MENU-SECTIONS-LINK-HOVER-color); -} - -#sidebar ul li.active > a { - background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); - color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; -} - -#sidebar hr { - border-color: var(--MENU-SECTION-HR-color); -} - -#body .tags a.tag-link { - background-color: var(--MENU-HEADER-BG-color); -} - -#body .tags a.tag-link:before { - border-right-color: var(--MENU-HEADER-BG-color); -} \ No newline at end of file diff --git a/fcs/docsrc/static/css/theme-green.css b/fcs/docsrc/static/css/theme-green.css deleted file mode 100644 index 3b0b1f7215..0000000000 --- a/fcs/docsrc/static/css/theme-green.css +++ /dev/null @@ -1,111 +0,0 @@ - -:root{ - - --MAIN-TEXT-color:#323232; /* Color of text by default */ - --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */ - --MAIN-LINK-color:#599a3e; /* Color of links */ - --MAIN-LINK-HOVER-color:#3f6d2c; /* Color of hovered links */ - --MAIN-ANCHOR-color: #599a3e; /* color of anchors on titles */ - - --MENU-HEADER-BG-color:#74b559; /* Background color of menu header */ - --MENU-HEADER-BORDER-color:#9cd484; /*Color of menu header border */ - - --MENU-SEARCH-BG-color:#599a3e; /* Search field background color (by default borders + icons) */ - --MENU-SEARCH-BOX-color: #84c767; /* Override search field border color */ - --MENU-SEARCH-BOX-ICONS-color: #c7f7c4; /* Override search field icons color */ - - --MENU-SECTIONS-ACTIVE-BG-color:#1b211c; /* Background color of the active section and its childs */ - --MENU-SECTIONS-BG-color:#222723; /* Background color of other sections */ - --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ - --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ - --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */ - --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */ - - --MENU-VISITED-color: #599a3e; /* Color of 'page visited' icons in menu */ - --MENU-SECTION-HR-color: #18211c; /* Color of
separator in menu */ - -} - -body { - color: var(--MAIN-TEXT-color) !important; -} - -textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { - border-color: none; - box-shadow: none; -} - -h2, h3, h4, h5 { - color: var(--MAIN-TITLES-TEXT-color) !important; -} - -a { - color: var(--MAIN-LINK-color); -} - -.anchor { - color: var(--MAIN-ANCHOR-color); -} - -a:hover { - color: var(--MAIN-LINK-HOVER-color); -} - -#sidebar ul li.visited > a .read-icon { - color: var(--MENU-VISITED-color); -} - -#body a.highlight:after { - display: block; - content: ""; - height: 1px; - width: 0%; - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -ms-transition: width 0.5s ease; - transition: width 0.5s ease; - background-color: var(--MAIN-LINK-HOVER-color); -} -#sidebar { - background-color: var(--MENU-SECTIONS-BG-color); -} -#sidebar #header-wrapper { - background: var(--MENU-HEADER-BG-color); - color: var(--MENU-SEARCH-BOX-color); - border-color: var(--MENU-HEADER-BORDER-color); -} -#sidebar .searchbox { - border-color: var(--MENU-SEARCH-BOX-color); - background: var(--MENU-SEARCH-BG-color); -} -#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { - background: var(--MENU-SECTIONS-ACTIVE-BG-color); -} -#sidebar .searchbox * { - color: var(--MENU-SEARCH-BOX-ICONS-color); -} - -#sidebar a { - color: var(--MENU-SECTIONS-LINK-color); -} - -#sidebar a:hover { - color: var(--MENU-SECTIONS-LINK-HOVER-color); -} - -#sidebar ul li.active > a { - background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); - color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; -} - -#sidebar hr { - border-color: var(--MENU-SECTION-HR-color); -} - -#body .tags a.tag-link { - background-color: var(--MENU-HEADER-BG-color); -} - -#body .tags a.tag-link:before { - border-right-color: var(--MENU-HEADER-BG-color); -} \ No newline at end of file diff --git a/fcs/docsrc/static/css/theme-red.css b/fcs/docsrc/static/css/theme-red.css deleted file mode 100644 index 36c9278e56..0000000000 --- a/fcs/docsrc/static/css/theme-red.css +++ /dev/null @@ -1,111 +0,0 @@ - -:root{ - - --MAIN-TEXT-color:#323232; /* Color of text by default */ - --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */ - --MAIN-LINK-color:#f31c1c; /* Color of links */ - --MAIN-LINK-HOVER-color:#d01616; /* Color of hovered links */ - --MAIN-ANCHOR-color: #f31c1c; /* color of anchors on titles */ - - --MENU-HEADER-BG-color:#dc1010; /* Background color of menu header */ - --MENU-HEADER-BORDER-color:#e23131; /*Color of menu header border */ - - --MENU-SEARCH-BG-color:#b90000; /* Search field background color (by default borders + icons) */ - --MENU-SEARCH-BOX-color: #ef2020; /* Override search field border color */ - --MENU-SEARCH-BOX-ICONS-color: #fda1a1; /* Override search field icons color */ - - --MENU-SECTIONS-ACTIVE-BG-color:#2b2020; /* Background color of the active section and its childs */ - --MENU-SECTIONS-BG-color:#312525; /* Background color of other sections */ - --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */ - --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */ - --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */ - --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */ - - --MENU-VISITED-color: #ff3333; /* Color of 'page visited' icons in menu */ - --MENU-SECTION-HR-color: #2b2020; /* Color of
separator in menu */ - -} - -body { - color: var(--MAIN-TEXT-color) !important; -} - -textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { - border-color: none; - box-shadow: none; -} - -h2, h3, h4, h5 { - color: var(--MAIN-TITLES-TEXT-color) !important; -} - -a { - color: var(--MAIN-LINK-color); -} - -.anchor { - color: var(--MAIN-ANCHOR-color); -} - -a:hover { - color: var(--MAIN-LINK-HOVER-color); -} - -#sidebar ul li.visited > a .read-icon { - color: var(--MENU-VISITED-color); -} - -#body a.highlight:after { - display: block; - content: ""; - height: 1px; - width: 0%; - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -ms-transition: width 0.5s ease; - transition: width 0.5s ease; - background-color: var(--MAIN-LINK-HOVER-color); -} -#sidebar { - background-color: var(--MENU-SECTIONS-BG-color); -} -#sidebar #header-wrapper { - background: var(--MENU-HEADER-BG-color); - color: var(--MENU-SEARCH-BOX-color); - border-color: var(--MENU-HEADER-BORDER-color); -} -#sidebar .searchbox { - border-color: var(--MENU-SEARCH-BOX-color); - background: var(--MENU-SEARCH-BG-color); -} -#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { - background: var(--MENU-SECTIONS-ACTIVE-BG-color); -} -#sidebar .searchbox * { - color: var(--MENU-SEARCH-BOX-ICONS-color); -} - -#sidebar a { - color: var(--MENU-SECTIONS-LINK-color); -} - -#sidebar a:hover { - color: var(--MENU-SECTIONS-LINK-HOVER-color); -} - -#sidebar ul li.active > a { - background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color); - color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important; -} - -#sidebar hr { - border-color: var(--MENU-SECTION-HR-color); -} - -#body .tags a.tag-link { - background-color: var(--MENU-HEADER-BG-color); -} - -#body .tags a.tag-link:before { - border-right-color: var(--MENU-HEADER-BG-color); -} \ No newline at end of file diff --git a/fcs/docsrc/static/css/theme.css b/fcs/docsrc/static/css/theme.css deleted file mode 100644 index badf53a307..0000000000 --- a/fcs/docsrc/static/css/theme.css +++ /dev/null @@ -1,1233 +0,0 @@ -@charset "UTF-8"; - -/* Tags */ -@import "tags.css"; - -#top-github-link, #body #breadcrumbs { - position: relative; - top: 50%; - -webkit-transform: translateY(-50%); - -moz-transform: translateY(-50%); - -o-transform: translateY(-50%); - -ms-transform: translateY(-50%); - transform: translateY(-50%); -} -.button, .button-secondary { - display: inline-block; - padding: 7px 12px; -} -.button:active, .button-secondary:active { - margin: 2px 0 -2px 0; -} -@font-face { - font-family: 'Novacento Sans Wide'; - src: url("../fonts/Novecentosanswide-UltraLight-webfont.eot"); - src: url("../fonts/Novecentosanswide-UltraLight-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/Novecentosanswide-UltraLight-webfont.woff2") format("woff2"), url("../fonts/Novecentosanswide-UltraLight-webfont.woff") format("woff"), url("../fonts/Novecentosanswide-UltraLight-webfont.ttf") format("truetype"), url("../fonts/Novecentosanswide-UltraLight-webfont.svg#novecento_sans_wideultralight") format("svg"); - font-style: normal; - font-weight: 200; -} -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 300; - src: url("../fonts/Work_Sans_300.eot?#iefix") format("embedded-opentype"), url("../fonts/Work_Sans_300.woff") format("woff"), url("../fonts/Work_Sans_300.woff2") format("woff2"), url("../fonts/Work_Sans_300.svg#WorkSans") format("svg"), url("../fonts/Work_Sans_300.ttf") format("truetype"); -} -@font-face { - font-family: 'Work Sans'; - font-style: normal; - font-weight: 500; - src: url("../fonts/Work_Sans_500.eot?#iefix") format("embedded-opentype"), url("../fonts/Work_Sans_500.woff") format("woff"), url("../fonts/Work_Sans_500.woff2") format("woff2"), url("../fonts/Work_Sans_500.svg#WorkSans") format("svg"), url("../fonts/Work_Sans_500.ttf") format("truetype"); -} -body { - background: #fff; - color: #777; -} -body #chapter h1 { - font-size: 3.5rem; -} -@media only all and (min-width: 48em) and (max-width: 59.938em) { - body #chapter h1 { - font-size: 3rem; - } -} -@media only all and (max-width: 47.938em) { - body #chapter h1 { - font-size: 2rem; - } -} -a { - color: #00bdf3; -} -a:hover { - color: #0082a7; -} -pre { - position: relative; - color: #ffffff; -} -.bg { - background: #fff; - border: 1px solid #eaeaea; -} -b, strong, label, th { - font-weight: 600; -} -.default-animation, #header #logo-svg, #header #logo-svg path, #sidebar, #sidebar ul, #body, #body .padding, #body .nav { - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - transition: all 0.5s ease; -} -#grav-logo { - max-width: 60%; -} -#grav-logo path { - fill: #fff !important; -} -#sidebar { - font-weight: 300 !important; -} -fieldset { - border: 1px solid #ddd; -} -textarea, input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], select[multiple=multiple] { - background-color: white; - border: 1px solid #ddd; - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06); -} -textarea:hover, input[type="email"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="text"]:hover, input[type="url"]:hover, input[type="color"]:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[type="datetime-local"]:hover, input[type="month"]:hover, input[type="time"]:hover, input[type="week"]:hover, select[multiple=multiple]:hover { - border-color: #c4c4c4; -} -textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus { - border-color: #00bdf3; - box-shadow: inset 0 1px 3px rgba(0,0,0,.06),0 0 5px rgba(0,169,218,.7) -} -#header-wrapper { - background: #8451a1; - color: #fff; - text-align: center; - border-bottom: 4px solid #9c6fb6; - padding: 1rem; -} -#header a { - display: inline-block; -} -#header #logo-svg { - width: 8rem; - height: 2rem; -} -#header #logo-svg path { - fill: #fff; -} -.searchbox { - margin-top: 1rem; - position: relative; - border: 1px solid #915eae; - background: #764890; - border-radius: 4px; -} -.searchbox label { - color: rgba(255, 255, 255, 0.8); - position: absolute; - left: 10px; - top: 3px; -} -.searchbox span { - color: rgba(255, 255, 255, 0.6); - position: absolute; - right: 10px; - top: 3px; - cursor: pointer; -} -.searchbox span:hover { - color: rgba(255, 255, 255, 0.9); -} -.searchbox input { - display: inline-block; - color: #fff; - width: 100%; - height: 30px; - background: transparent; - border: 0; - padding: 0 25px 0 30px; - margin: 0; - font-weight: 300; -} -.searchbox input::-webkit-input-placeholder { - color: rgba(255, 255, 255, 0.6); -} -.searchbox input::-moz-placeholder { - color: rgba(255, 255, 255, 0.6); -} -.searchbox input:-moz-placeholder { - color: rgba(255, 255, 255, 0.6); -} -.searchbox input:-ms-input-placeholder { - color: rgba(255, 255, 255, 0.6); -} -#sidebar-toggle-span { - display: none; -} -@media only all and (max-width: 47.938em) { - #sidebar-toggle-span { - display: inline; - } -} -#sidebar { - background-color: #322A38; - position: fixed; - top: 0; - width: 300px; - bottom: 0; - left: 0; - font-weight: 400; - font-size: 15px; -} -#sidebar a { - color: #ccc; -} -#sidebar a:hover { - color: #e6e6e6; -} -#sidebar a.subtitle { - color: rgba(204, 204, 204, 0.6); -} -#sidebar hr { - border-bottom: 1px solid #2a232f; -} -#sidebar a.padding { - padding: 0 1rem; -} -#sidebar h5 { - margin: 2rem 0 0; - position: relative; - line-height: 2; -} -#sidebar h5 a { - display: block; - margin-left: 0; - margin-right: 0; - padding-left: 1rem; - padding-right: 1rem; -} -#sidebar h5 i { - color: rgba(204, 204, 204, 0.6); - position: absolute; - right: 0.6rem; - top: 0.7rem; - font-size: 80%; -} -#sidebar h5.parent a { - background: #201b24; - color: #d9d9d9 !important; -} -#sidebar h5.active a { - background: #fff; - color: #777 !important; -} -#sidebar h5.active i { - color: #777 !important; -} -#sidebar h5 + ul.topics { - display: none; - margin-top: 0; -} -#sidebar h5.parent + ul.topics, #sidebar h5.active + ul.topics { - display: block; -} -#sidebar ul { - list-style: none; - padding: 0; - margin: 0; -} -#sidebar ul.searched a { - color: #999999; -} -#sidebar ul.searched .search-match a { - color: #e6e6e6; -} -#sidebar ul.searched .search-match a:hover { - color: white; -} -#sidebar ul.topics { - margin: 0 1rem; -} -#sidebar ul.topics.searched ul { - display: block; -} -#sidebar ul.topics ul { - display: none; - padding-bottom: 1rem; -} -#sidebar ul.topics ul ul { - padding-bottom: 0; -} -#sidebar ul.topics li.parent ul, #sidebar ul.topics > li.active ul { - display: block; -} -#sidebar ul.topics > li > a { - line-height: 2rem; - font-size: 1.1rem; -} -#sidebar ul.topics > li > a b { - opacity: 0.5; - font-weight: normal; -} -#sidebar ul.topics > li > a .fa { - margin-top: 9px; -} -#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { - background: #251f29; - margin-left: -1rem; - margin-right: -1rem; - padding-left: 1rem; - padding-right: 1rem; -} -#sidebar ul li.active > a { - background: #fff; - color: #777 !important; - margin-left: -1rem; - margin-right: -1rem; - padding-left: 1rem; - padding-right: 1rem; -} -#sidebar ul li { - padding: 0; -} -#sidebar ul li.visited + span { - margin-right: 16px; -} -#sidebar ul li a { - display: block; - padding: 2px 0; -} -#sidebar ul li a span { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - display: block; -} -#sidebar ul li > a { - padding: 4px 0; -} -#sidebar ul li.visited > a .read-icon { - color: #9c6fb6; - display: inline; -} -#sidebar ul li li { - padding-left: 1rem; - text-indent: 0.2rem; -} -#main { - background: #f7f7f7; - margin: 0 0 1.563rem 0; -} -#body { - position: relative; - margin-left: 300px; - min-height: 100%; -} -#body img, #body .video-container { - margin: 3rem auto; - display: block; - text-align: center; -} -#body img.border, #body .video-container.border { - border: 2px solid #e6e6e6 !important; - padding: 2px; -} -#body img.shadow, #body .video-container.shadow { - box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); -} -#body img.inline { - display: inline !important; - margin: 0 !important; - vertical-align: bottom; -} -#body .bordered { - border: 1px solid #ccc; -} -#body .padding { - padding: 3rem 6rem; -} -@media only all and (max-width: 79.938em) { - #body .padding { - position: static; - padding: 15px 3rem; - } -} - -@media only all and (max-width: 59.938em) { - #body .padding { - position: static; - padding: 15px 1rem; - } -} -@media only all and (max-width: 47.938em) { - #body .padding { - padding: 5px 1rem; - } -} -#body h1 + hr { - margin-top: -1.7rem; - margin-bottom: 3rem; -} -@media only all and (max-width: 59.938em) { - #body #navigation { - position: static; - margin-right: 0 !important; - width: 100%; - display: table; - } -} -#body .nav { - position: fixed; - top: 0; - bottom: 0; - width: 4rem; - font-size: 50px; - height: 100%; - cursor: pointer; - display: table; - text-align: center; -} -#body .nav > i { - display: table-cell; - vertical-align: middle; - text-align: center; -} -@media only all and (max-width: 59.938em) { - #body .nav { - display: table-cell; - position: static; - top: auto; - width: 50%; - text-align: center; - height: 100px; - line-height: 100px; - padding-top: 0; - } - #body .nav > i { - display: inline-block; - } -} -#body .nav:hover { - background: #F6F6F6; -} -#body .nav.nav-pref { - left: 0; -} -#body .nav.nav-next { - right: 0; -} -#body-inner { - margin-bottom: 5rem; -} -#chapter { - display: flex; - align-items: center; - justify-content: center; - height: 100%; - padding: 2rem 0; -} -#chapter #body-inner { - padding-bottom: 3rem; - max-width: 80%; -} -#chapter h3 { - font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - font-weight: 300; - text-align: center; -} -#chapter h1 { - font-size: 5rem; - border-bottom: 4px solid #F0F2F4; -} -#chapter p { - text-align: center; - font-size: 1.2rem; -} -#footer { - padding: 3rem 1rem; - color: #b3b3b3; - font-size: 13px; -} -#footer p { - margin: 0; -} -body { - font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - font-weight: 300; - line-height: 1.6; - font-size: 18px !important; -} -h2, h3, h4, h5, h6 { - font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - text-rendering: optimizeLegibility; - color: #5e5e5e; - font-weight: 400; - letter-spacing: -1px; -} -h1 { - font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - text-align: center; - text-transform: uppercase; - color: #222; - font-weight: 200; -} -blockquote { - border-left: 10px solid #F0F2F4; -} -blockquote p { - font-size: 1.1rem; - color: #999; -} -blockquote cite { - display: block; - text-align: right; - color: #666; - font-size: 1.2rem; -} -div.notices { - margin: 2rem 0; - position: relative; -} -div.notices p { - padding: 15px; - display: block; - font-size: 1rem; - margin-top: 0rem; - margin-bottom: 0rem; - color: #666; -} -div.notices p:first-child:before { - position: absolute; - top: 2px; - color: #fff; - font-family: "Font Awesome 5 Free"; - font-weight: 900; - content: "\f06a"; - left: 10px; -} -div.notices p:first-child:after { - position: absolute; - top: 2px; - color: #fff; - left: 2rem; -} -div.notices.info p { - border-top: 30px solid #F0B37E; - background: #FFF2DB; -} -div.notices.info p:first-child:after { - content: 'Info'; -} -div.notices.warning p { - border-top: 30px solid rgba(217, 83, 79, 0.8); - background: #FAE2E2; -} -div.notices.warning p:first-child:after { - content: 'Warning'; -} -div.notices.note p { - border-top: 30px solid #6AB0DE; - background: #E7F2FA; -} -div.notices.note p:first-child:after { - content: 'Note'; -} -div.notices.tip p { - border-top: 30px solid rgba(92, 184, 92, 0.8); - background: #E6F9E6; -} -div.notices.tip p:first-child:after { - content: 'Tip'; -} - -/* attachments shortcode */ - -section.attachments { - margin: 2rem 0; - position: relative; -} - -section.attachments label { - font-weight: 400; - padding-left: 0.5em; - padding-top: 0.2em; - padding-bottom: 0.2em; - margin: 0; -} - -section.attachments .attachments-files { - padding: 15px; - display: block; - font-size: 1rem; - margin-top: 0rem; - margin-bottom: 0rem; - color: #666; -} - -section.attachments.orange label { - color: #fff; - background: #F0B37E; -} - -section.attachments.orange .attachments-files { - background: #FFF2DB; -} - -section.attachments.green label { - color: #fff; - background: rgba(92, 184, 92, 0.8); -} - -section.attachments.green .attachments-files { - background: #E6F9E6; -} - -section.attachments.blue label { - color: #fff; - background: #6AB0DE; -} - -section.attachments.blue .attachments-files { - background: #E7F2FA; -} - -section.attachments.grey label { - color: #fff; - background: #505d65; -} - -section.attachments.grey .attachments-files { - background: #f4f4f4; -} - -/* Children shortcode */ - -/* Children shortcode */ -.children p { - font-size: small; - margin-top: 0px; - padding-top: 0px; - margin-bottom: 0px; - padding-bottom: 0px; -} -.children-li p { - font-size: small; - font-style: italic; - -} -.children-h2 p, .children-h3 p { - font-size: small; - margin-top: 0px; - padding-top: 0px; - margin-bottom: 0px; - padding-bottom: 0px; -} -.children h3,.children h2 { - margin-bottom: 0px; - margin-top: 5px; -} - -code, kbd, pre, samp { - font-family: "Consolas", menlo, monospace; - font-size: 92%; -} -code { - border-radius: 2px; - white-space: nowrap; - color: #5e5e5e; - background: #FFF7DD; - border: 1px solid #fbf0cb; - padding: 0px 2px; -} -code + .copy-to-clipboard { - margin-left: -1px; - border-left: 0 !important; - font-size: inherit !important; - vertical-align: middle; - height: 21px; - top: 0; -} -pre { - padding: 1rem; - margin: 2rem 0; - background: #282c34; - border: 0; - border-radius: 2px; - line-height: 1.15; -} -pre code { - color: whitesmoke; - background: inherit; - white-space: inherit; - border: 0; - padding: 0; - margin: 0; - font-size: 15px; -} -hr { - border-bottom: 4px solid #F0F2F4; -} -.page-title { - margin-top: -25px; - padding: 25px; - float: left; - clear: both; - background: #9c6fb6; - color: #fff; -} -#body a.anchor-link { - color: #ccc; -} -#body a.anchor-link:hover { - color: #9c6fb6; -} -#body-inner .tabs-wrapper.ui-theme-badges { - background: #1d1f21; -} -#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li { - font-size: 0.9rem; - text-transform: uppercase; -} -#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li a { - background: #35393c; -} -#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li.current a { - background: #4d5257; -} -#body-inner pre { - white-space: pre-wrap; -} -.tabs-wrapper pre { - margin: 1rem 0; - border: 0; - padding: 0; - background: inherit; -} -table { - border: 1px solid #eaeaea; - table-layout: auto; -} -th { - background: #f7f7f7; - padding: 0.5rem; -} -td { - padding: 0.5rem; - border: 1px solid #eaeaea; -} -.button { - background: #9c6fb6; - color: #fff; - box-shadow: 0 3px 0 #00a5d4; -} -.button:hover { - background: #00a5d4; - box-shadow: 0 3px 0 #008db6; - color: #fff; -} -.button:active { - box-shadow: 0 1px 0 #008db6; -} -.button-secondary { - background: #F8B450; - color: #fff; - box-shadow: 0 3px 0 #f7a733; -} -.button-secondary:hover { - background: #f7a733; - box-shadow: 0 3px 0 #f69b15; - color: #fff; -} -.button-secondary:active { - box-shadow: 0 1px 0 #f69b15; -} -.bullets { - margin: 1.7rem 0; - margin-left: -0.85rem; - margin-right: -0.85rem; - overflow: auto; -} -.bullet { - float: left; - padding: 0 0.85rem; -} -.two-column-bullet { - width: 50%; -} -@media only all and (max-width: 47.938em) { - .two-column-bullet { - width: 100%; - } -} -.three-column-bullet { - width: 33.33333%; -} -@media only all and (max-width: 47.938em) { - .three-column-bullet { - width: 100%; - } -} -.four-column-bullet { - width: 25%; -} -@media only all and (max-width: 47.938em) { - .four-column-bullet { - width: 100%; - } -} -.bullet-icon { - float: left; - background: #9c6fb6; - padding: 0.875rem; - width: 3.5rem; - height: 3.5rem; - border-radius: 50%; - color: #fff; - font-size: 1.75rem; - text-align: center; -} -.bullet-icon-1 { - background: #9c6fb6; -} -.bullet-icon-2 { - background: #00f3d8; -} -.bullet-icon-3 { - background: #e6f300; -} -.bullet-content { - margin-left: 4.55rem; -} -.tooltipped { - position: relative; -} -.tooltipped:after { - position: absolute; - z-index: 1000000; - display: none; - padding: 5px 8px; - font: normal normal 11px/1.5 "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - color: #fff; - text-align: center; - text-decoration: none; - text-shadow: none; - text-transform: none; - letter-spacing: normal; - word-wrap: break-word; - white-space: pre; - pointer-events: none; - content: attr(aria-label); - background: rgba(0, 0, 0, 0.8); - border-radius: 3px; - -webkit-font-smoothing: subpixel-antialiased; -} -.tooltipped:before { - position: absolute; - z-index: 1000001; - display: none; - width: 0; - height: 0; - color: rgba(0, 0, 0, 0.8); - pointer-events: none; - content: ""; - border: 5px solid transparent; -} -.tooltipped:hover:before, .tooltipped:hover:after, .tooltipped:active:before, .tooltipped:active:after, .tooltipped:focus:before, .tooltipped:focus:after { - display: inline-block; - text-decoration: none; -} -.tooltipped-s:after, .tooltipped-se:after, .tooltipped-sw:after { - top: 100%; - right: 50%; - margin-top: 5px; -} -.tooltipped-s:before, .tooltipped-se:before, .tooltipped-sw:before { - top: auto; - right: 50%; - bottom: -5px; - margin-right: -5px; - border-bottom-color: rgba(0, 0, 0, 0.8); -} -.tooltipped-se:after { - right: auto; - left: 50%; - margin-left: -15px; -} -.tooltipped-sw:after { - margin-right: -15px; -} -.tooltipped-n:after, .tooltipped-ne:after, .tooltipped-nw:after { - right: 50%; - bottom: 100%; - margin-bottom: 5px; -} -.tooltipped-n:before, .tooltipped-ne:before, .tooltipped-nw:before { - top: -5px; - right: 50%; - bottom: auto; - margin-right: -5px; - border-top-color: rgba(0, 0, 0, 0.8); -} -.tooltipped-ne:after { - right: auto; - left: 50%; - margin-left: -15px; -} -.tooltipped-nw:after { - margin-right: -15px; -} -.tooltipped-s:after, .tooltipped-n:after { - transform: translateX(50%); -} -.tooltipped-w:after { - right: 100%; - bottom: 50%; - margin-right: 5px; - transform: translateY(50%); -} -.tooltipped-w:before { - top: 50%; - bottom: 50%; - left: -5px; - margin-top: -5px; - border-left-color: rgba(0, 0, 0, 0.8); -} -.tooltipped-e:after { - bottom: 50%; - left: 100%; - margin-left: 5px; - transform: translateY(50%); -} -.tooltipped-e:before { - top: 50%; - right: -5px; - bottom: 50%; - margin-top: -5px; - border-right-color: rgba(0, 0, 0, 0.8); -} -.highlightable { - padding: 1rem 0 1rem; - overflow: auto; - position: relative; -} -.hljs::selection, .hljs span::selection { - background: #b7b7b7; -} -.lightbox-active #body { - overflow: visible; -} -.lightbox-active #body .padding { - overflow: visible; -} -#github-contrib i { - vertical-align: middle; -} -.featherlight img { - margin: 0 !important; -} -.lifecycle #body-inner ul { - list-style: none; - margin: 0; - padding: 2rem 0 0; - position: relative; -} -.lifecycle #body-inner ol { - margin: 1rem 0 1rem 0; - padding: 2rem; - position: relative; -} -.lifecycle #body-inner ol li { - margin-left: 1rem; -} -.lifecycle #body-inner ol strong, .lifecycle #body-inner ol label, .lifecycle #body-inner ol th { - text-decoration: underline; -} -.lifecycle #body-inner ol ol { - margin-left: -1rem; -} -.lifecycle #body-inner h3[class*='level'] { - font-size: 20px; - position: absolute; - margin: 0; - padding: 4px 10px; - right: 0; - z-index: 1000; - color: #fff; - background: #1ABC9C; -} -.lifecycle #body-inner ol h3 { - margin-top: 1rem !important; - right: 2rem !important; -} -.lifecycle #body-inner .level-1 + ol { - background: #f6fefc; - border: 4px solid #1ABC9C; - color: #16A085; -} -.lifecycle #body-inner .level-1 + ol h3 { - background: #2ECC71; -} -.lifecycle #body-inner .level-2 + ol { - background: #f7fdf9; - border: 4px solid #2ECC71; - color: #27AE60; -} -.lifecycle #body-inner .level-2 + ol h3 { - background: #3498DB; -} -.lifecycle #body-inner .level-3 + ol { - background: #f3f9fd; - border: 4px solid #3498DB; - color: #2980B9; -} -.lifecycle #body-inner .level-3 + ol h3 { - background: #34495E; -} -.lifecycle #body-inner .level-4 + ol { - background: #e4eaf0; - border: 4px solid #34495E; - color: #2C3E50; -} -.lifecycle #body-inner .level-4 + ol h3 { - background: #34495E; -} -#top-bar { - background: #F6F6F6; - border-radius: 2px; - padding: 0 1rem; - height: 0; - min-height: 3rem; -} -#top-github-link { - position: relative; - z-index: 1; - float: right; - display: block; -} -#body #breadcrumbs { - height: auto; - margin-bottom: 0; - padding-left: 0; - line-height: 1.4; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - width: 70%; - display: inline-block; - float: left; -} -#body #breadcrumbs span { - padding: 0 0.1rem; -} -@media only all and (max-width: 59.938em) { - #sidebar { - width: 230px; - } - #body { - margin-left: 230px; - } -} -@media only all and (max-width: 47.938em) { - #sidebar { - width: 230px; - left: -230px; - } - #body { - margin-left: 0; - width: 100%; - } - .sidebar-hidden { - overflow: hidden; - } - .sidebar-hidden #sidebar { - left: 0; - } - .sidebar-hidden #body { - margin-left: 230px; - overflow: hidden; - } - .sidebar-hidden #overlay { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - z-index: 10; - background: rgba(255, 255, 255, 0.5); - cursor: pointer; - } -} -.copy-to-clipboard { - background-image: url(../images/clippy.svg); - background-position: 50% 50%; - background-size: 16px 16px; - background-repeat: no-repeat; - width: 27px; - height: 1.45rem; - top: -1px; - display: inline-block; - vertical-align: middle; - position: relative; - color: #5e5e5e; - background-color: #FFF7DD; - margin-left: -.2rem; - cursor: pointer; - border-radius: 0 2px 2px 0; - margin-bottom: 1px; -} -.copy-to-clipboard:hover { - background-color: #E8E2CD; -} -pre .copy-to-clipboard { - position: absolute; - right: 4px; - top: 4px; - background-color: #949bab; - color: #ccc; - border-radius: 2px; -} -pre .copy-to-clipboard:hover { - background-color: #656c72; - color: #fff; -} -.parent-element { - -webkit-transform-style: preserve-3d; - -moz-transform-style: preserve-3d; - transform-style: preserve-3d; -} - -#sidebar ul.topics > li > a .read-icon { - margin-top: 9px; -} - -#sidebar ul { - list-style: none; - padding: 0; - margin: 0; -} - -#sidebar #shortcuts li { - padding: 2px 0; - list-style: none; -} - -#sidebar ul li .read-icon { - display: none; - float: right; - font-size: 13px; - min-width: 16px; - margin: 4px 0 0 0; - text-align: right; -} -#sidebar ul li.visited > a .read-icon { - color: #00bdf3; - display: inline; -} - -#sidebar #shortcuts h3 { - font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - color: white ; - margin-top:1rem; - padding-left: 1rem; -} - -#searchResults { - text-align: left; -} - -option { - color: initial; -} - -#logo { - font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif !important; - color: white !important; - margin-bottom: 0; - text-transform: uppercase; -} - -.searchbox i { - margin-top: 5px; -} - -.summary { - margin-top: 0; - margin-bottom: 0; -} - -.api-page table{ - margin-top: 20px; -} - -.highlight { - display: inline-block !important; -} - -.gif { - max-height: 500px; -} - -.sponsor { - height: 70px !important; - margin-top: 25px !important; - display: inline-block !important; - } - -#logo-pic { - height: 60px !important; -} - -.submenu { - margin-top: 30px !important; - padding-left: 13px !important; - display: none; -} - -.submenu-active { - display: block; -} - -.active-link { - text-decoration: underline; -} - -.menu-group-link a{ - padding-left: 10px !important; - border-left: 3px solid transparent; - text-transform: uppercase; - cursor: pointer; -} - -.menu-group-link a:hover{ - border-left: 3px solid #0082a7; -} - -.menu-group-link-active { - border-left: 3px solid #0082a7; -} - - -#body-inner p { - margin: 0.8rem 0; -} - -#body-inner pre { - margin: 1.2rem 0; -} - - -#sidebar #languages li { - padding: 2px 0; - list-style: none; -} - - -#sidebar #languages h3 { - font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - color: white ; - margin-top:1rem; - padding-left: 1rem; -} \ No newline at end of file diff --git a/fcs/docsrc/static/css/tips.css b/fcs/docsrc/static/css/tips.css deleted file mode 100644 index cc4d7a3685..0000000000 --- a/fcs/docsrc/static/css/tips.css +++ /dev/null @@ -1,10 +0,0 @@ -/* tool tip */ -div.tip { - background:#475b5f; - border-radius:4px; - font:11pt 'Droid Sans', arial, sans-serif; - padding:6px 8px 6px 8px; - display:none; - color:#d1d1d1; - pointer-events:none; -} \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Inconsolata.eot b/fcs/docsrc/static/fonts/Inconsolata.eot deleted file mode 100644 index 0a705d653f..0000000000 Binary files a/fcs/docsrc/static/fonts/Inconsolata.eot and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Inconsolata.svg b/fcs/docsrc/static/fonts/Inconsolata.svg deleted file mode 100644 index 36775f0749..0000000000 --- a/fcs/docsrc/static/fonts/Inconsolata.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Inconsolata.ttf b/fcs/docsrc/static/fonts/Inconsolata.ttf deleted file mode 100644 index 4b8a36d249..0000000000 Binary files a/fcs/docsrc/static/fonts/Inconsolata.ttf and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Inconsolata.woff b/fcs/docsrc/static/fonts/Inconsolata.woff deleted file mode 100644 index 6f39625e58..0000000000 Binary files a/fcs/docsrc/static/fonts/Inconsolata.woff and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.eot b/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.eot deleted file mode 100644 index 9984682fc9..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.eot and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.svg b/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.svg deleted file mode 100644 index 6fa1a66e30..0000000000 --- a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.ttf b/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.ttf deleted file mode 100644 index 8cfb62dd59..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.ttf and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.woff b/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.woff deleted file mode 100644 index d5c4290791..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.woff and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.woff2 b/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.woff2 deleted file mode 100644 index eefb4a3186..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-Normal-webfont.woff2 and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.eot b/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.eot deleted file mode 100644 index 2a26561f90..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.eot and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.svg b/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.svg deleted file mode 100644 index c4e903b61a..0000000000 --- a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.ttf b/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.ttf deleted file mode 100644 index 9ce9c7f99d..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.ttf and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.woff b/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.woff deleted file mode 100644 index 381650c98d..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.woff and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.woff2 b/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.woff2 deleted file mode 100644 index 7e659549bc..0000000000 Binary files a/fcs/docsrc/static/fonts/Novecentosanswide-UltraLight-webfont.woff2 and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_200.eot b/fcs/docsrc/static/fonts/Work_Sans_200.eot deleted file mode 100644 index 4052e4f94a..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_200.eot and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_200.svg b/fcs/docsrc/static/fonts/Work_Sans_200.svg deleted file mode 100644 index 0ffbd3a845..0000000000 --- a/fcs/docsrc/static/fonts/Work_Sans_200.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Work_Sans_200.ttf b/fcs/docsrc/static/fonts/Work_Sans_200.ttf deleted file mode 100644 index 68019e1ccd..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_200.ttf and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_200.woff b/fcs/docsrc/static/fonts/Work_Sans_200.woff deleted file mode 100644 index a1bd9e4699..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_200.woff and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_200.woff2 b/fcs/docsrc/static/fonts/Work_Sans_200.woff2 deleted file mode 100644 index 20c68a75c4..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_200.woff2 and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_300.eot b/fcs/docsrc/static/fonts/Work_Sans_300.eot deleted file mode 100644 index ace799382a..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_300.eot and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_300.svg b/fcs/docsrc/static/fonts/Work_Sans_300.svg deleted file mode 100644 index 7d2936783b..0000000000 --- a/fcs/docsrc/static/fonts/Work_Sans_300.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Work_Sans_300.ttf b/fcs/docsrc/static/fonts/Work_Sans_300.ttf deleted file mode 100644 index 35387c2357..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_300.ttf and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_300.woff b/fcs/docsrc/static/fonts/Work_Sans_300.woff deleted file mode 100644 index 8d789eae97..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_300.woff and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_300.woff2 b/fcs/docsrc/static/fonts/Work_Sans_300.woff2 deleted file mode 100644 index f6e216d64d..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_300.woff2 and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_500.eot b/fcs/docsrc/static/fonts/Work_Sans_500.eot deleted file mode 100644 index 9df6929428..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_500.eot and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_500.svg b/fcs/docsrc/static/fonts/Work_Sans_500.svg deleted file mode 100644 index 90a91c14cc..0000000000 --- a/fcs/docsrc/static/fonts/Work_Sans_500.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/fonts/Work_Sans_500.ttf b/fcs/docsrc/static/fonts/Work_Sans_500.ttf deleted file mode 100644 index 5b8cc5342b..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_500.ttf and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_500.woff b/fcs/docsrc/static/fonts/Work_Sans_500.woff deleted file mode 100644 index df058514fb..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_500.woff and /dev/null differ diff --git a/fcs/docsrc/static/fonts/Work_Sans_500.woff2 b/fcs/docsrc/static/fonts/Work_Sans_500.woff2 deleted file mode 100644 index b06c54df0b..0000000000 Binary files a/fcs/docsrc/static/fonts/Work_Sans_500.woff2 and /dev/null differ diff --git a/fcs/docsrc/static/images/clippy.svg b/fcs/docsrc/static/images/clippy.svg deleted file mode 100644 index f4551735e1..0000000000 --- a/fcs/docsrc/static/images/clippy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/fcs/docsrc/static/images/favicon.png b/fcs/docsrc/static/images/favicon.png deleted file mode 100644 index 9d7b823ec9..0000000000 Binary files a/fcs/docsrc/static/images/favicon.png and /dev/null differ diff --git a/fcs/docsrc/static/js/auto-complete.js b/fcs/docsrc/static/js/auto-complete.js deleted file mode 100644 index 0b46054568..0000000000 --- a/fcs/docsrc/static/js/auto-complete.js +++ /dev/null @@ -1,3 +0,0 @@ -// JavaScript autoComplete v1.0.4 -// https://github.com/Pixabay/JavaScript-autoComplete -var autoComplete=function(){function e(e){function t(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function o(e,t,o){e.attachEvent?e.attachEvent("on"+t,o):e.addEventListener(t,o)}function s(e,t,o){e.detachEvent?e.detachEvent("on"+t,o):e.removeEventListener(t,o)}function n(e,s,n,l){o(l||document,s,function(o){for(var s,l=o.target||o.srcElement;l&&!(s=t(l,e));)l=l.parentElement;s&&n.call(l,o)})}if(document.querySelector){var l={selector:0,source:0,minChars:3,delay:150,offsetLeft:0,offsetTop:1,cache:1,menuClass:"",renderItem:function(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var o=new RegExp("("+t.split(" ").join("|")+")","gi");return'
'+e.replace(o,"$1")+"
"},onSelect:function(){}};for(var c in e)e.hasOwnProperty(c)&&(l[c]=e[c]);for(var a="object"==typeof l.selector?[l.selector]:document.querySelectorAll(l.selector),u=0;u0?i.sc.scrollTop=n+i.sc.suggestionHeight+s-i.sc.maxHeight:0>n&&(i.sc.scrollTop=n+s)}else i.sc.scrollTop=0},o(window,"resize",i.updateSC),document.body.appendChild(i.sc),n("autocomplete-suggestion","mouseleave",function(){var e=i.sc.querySelector(".autocomplete-suggestion.selected");e&&setTimeout(function(){e.className=e.className.replace("selected","")},20)},i.sc),n("autocomplete-suggestion","mouseover",function(){var e=i.sc.querySelector(".autocomplete-suggestion.selected");e&&(e.className=e.className.replace("selected","")),this.className+=" selected"},i.sc),n("autocomplete-suggestion","mousedown",function(e){if(t(this,"autocomplete-suggestion")){var o=this.getAttribute("data-val");i.value=o,l.onSelect(e,o,this),i.sc.style.display="none"}},i.sc),i.blurHandler=function(){try{var e=document.querySelector(".autocomplete-suggestions:hover")}catch(t){var e=0}e?i!==document.activeElement&&setTimeout(function(){i.focus()},20):(i.last_val=i.value,i.sc.style.display="none",setTimeout(function(){i.sc.style.display="none"},350))},o(i,"blur",i.blurHandler);var r=function(e){var t=i.value;if(i.cache[t]=e,e.length&&t.length>=l.minChars){for(var o="",s=0;st||t>40)&&13!=t&&27!=t){var o=i.value;if(o.length>=l.minChars){if(o!=i.last_val){if(i.last_val=o,clearTimeout(i.timer),l.cache){if(o in i.cache)return void r(i.cache[o]);for(var s=1;s https://github.com/noelboss/featherlight/issues/317 -!function(u){"use strict";if(void 0!==u)if(u.fn.jquery.match(/-ajax/))"console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version.");else{var r=[],i=function(t){return r=u.grep(r,function(e){return e!==t&&0','
','",'
'+n.loading+"
","
",""].join("")),o="."+n.namespace+"-close"+(n.otherClose?","+n.otherClose:"");return n.$instance=i.clone().addClass(n.variant),n.$instance.on(n.closeTrigger+"."+n.namespace,function(e){if(!e.isDefaultPrevented()){var t=u(e.target);("background"===n.closeOnClick&&t.is("."+n.namespace)||"anywhere"===n.closeOnClick||t.closest(o).length)&&(n.close(e),e.preventDefault())}}),this},getContent:function(){if(!1!==this.persist&&this.$content)return this.$content;var t=this,e=this.constructor.contentFilters,n=function(e){return t.$currentTarget&&t.$currentTarget.attr(e)},r=n(t.targetAttr),i=t.target||r||"",o=e[t.type];if(!o&&i in e&&(o=e[i],i=t.target&&r),i=i||n("href")||"",!o)for(var a in e)t[a]&&(o=e[a],i=t[a]);if(!o){var s=i;if(i=null,u.each(t.contentFilters,function(){return(o=e[this]).test&&(i=o.test(s)),!i&&o.regex&&s.match&&s.match(o.regex)&&(i=s),!i}),!i)return"console"in window&&window.console.error("Featherlight: no content filter found "+(s?' for "'+s+'"':" (no target specified)")),!1}return o.process.call(t,i)},setContent:function(e){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",e.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(e).slice(1).remove().end().replaceWith(u.contains(this.$instance[0],e[0])?"":e),this.$content=e.addClass(this.namespace+"-inner"),this},open:function(t){var n=this;if(n.$instance.hide().appendTo(n.root),!(t&&t.isDefaultPrevented()||!1===n.beforeOpen(t))){t&&t.preventDefault();var e=n.getContent();if(e)return r.push(n),s(!0),n.$instance.fadeIn(n.openSpeed),n.beforeContent(t),u.when(e).always(function(e){n.setContent(e),n.afterContent(t)}).then(n.$instance.promise()).done(function(){n.afterOpen(t)})}return n.$instance.detach(),u.Deferred().reject().promise()},close:function(e){var t=this,n=u.Deferred();return!1===t.beforeClose(e)?n.reject():(0===i(t).length&&s(!1),t.$instance.fadeOut(t.closeSpeed,function(){t.$instance.detach(),t.afterClose(e),n.resolve()})),n.promise()},resize:function(e,t){if(e&&t&&(this.$content.css("width","").css("height",""),this.$content.parent().width()');return n.onload=function(){r.naturalWidth=n.width,r.naturalHeight=n.height,t.resolve(r)},n.onerror=function(){t.reject(r)},n.src=e,t.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(e){return u(e)}},ajax:{regex:/./,process:function(e){var n=u.Deferred(),r=u("
").load(e,function(e,t){"error"!==t&&n.resolve(r.contents()),n.fail()});return n.promise()}},iframe:{process:function(e){var t=new u.Deferred,n=u("