From 9cad0e4fc969bfc99d01a80f6024bbebe85a194a Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Wed, 3 Feb 2021 20:51:50 -0600 Subject: [PATCH] update vscode deps so that semantic tokens are supported (#1491) --- RELEASE_NOTES.md | 6 ++ package.json | 6 +- paket.lock | 34 ++++----- src/Components/HighlightingProvider.fs | 48 ------------- src/Core/LanguageService.fs | 6 +- src/Ionide.FSharp.fsproj | 1 - src/fsharp.fs | 1 - yarn.lock | 98 ++++++++++++++------------ 8 files changed, 84 insertions(+), 116 deletions(-) delete mode 100644 src/Components/HighlightingProvider.fs diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 33436d12..3646d789 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,9 @@ +### 5.3.0 - 03.02.2020 + +* Update FSAC: + * LSP support for semantic highlighting + * improvements to workspace/symbol + ### 5.2.0 - 13.01.2020 * Update Fable to 3.X * Only send FSharpDocumentation request when panel is open diff --git a/package.json b/package.json index acee42eb..b327a76c 100644 --- a/package.json +++ b/package.json @@ -8,15 +8,15 @@ "@babel/plugin-transform-runtime": "^7.11.5", "@babel/preset-env": "^7.11.5", "@types/showdown": "^1.9.3", - "@types/vscode": "^1.48.0", + "@types/vscode": "^1.52.0", "@types/ws": "^7.2.6", "axios": "^0.20.0", "babel-loader": "^8.1.0", "mocha": "^8.1.3", "showdown": "^1.9.1", "toml": "^3.0.0", - "vscode-debugadapter": "^1.41.1", - "vscode-languageclient": "^6.1.3", + "vscode-debugadapter": "^1.44.0", + "vscode-languageclient": "^7.0.0", "webpack": "^4.44.1", "webpack-cli": "^3.3.12", "ws": "^7.3.1", diff --git a/paket.lock b/paket.lock index 52768f46..850e3502 100644 --- a/paket.lock +++ b/paket.lock @@ -35,13 +35,13 @@ NUGET FSharp.Core (>= 4.7) GIT remote: https://github.com/fsharp/FsAutoComplete.git - (4373a5e69e866c778257b32b8ca159855f156a58) + (7891522a2213b3a8ad6cf6acddd778db810f058a) build: build.cmd os: win - (4373a5e69e866c778257b32b8ca159855f156a58) + (7891522a2213b3a8ad6cf6acddd778db810f058a) build: build.sh os: linux - (4373a5e69e866c778257b32b8ca159855f156a58) + (7891522a2213b3a8ad6cf6acddd778db810f058a) build: build.sh os: osx remote: https://github.com/ionide/ionide-fsgrammar.git @@ -216,27 +216,27 @@ NUGET System.Security.AccessControl (>= 5.0) System.Security.Principal.Windows (>= 5.0) Mono.Posix.NETStandard (1.0) - MSBuild.StructuredLogger (2.1.272) + MSBuild.StructuredLogger (2.1.303) Microsoft.Build (>= 16.4) Microsoft.Build.Framework (>= 16.4) Microsoft.Build.Tasks.Core (>= 16.4) Microsoft.Build.Utilities.Core (>= 16.4) Newtonsoft.Json (12.0.3) - NuGet.Common (5.8) - NuGet.Frameworks (>= 5.8) - NuGet.Configuration (5.8) - NuGet.Common (>= 5.8) + NuGet.Common (5.8.1) + NuGet.Frameworks (>= 5.8.1) + NuGet.Configuration (5.8.1) + NuGet.Common (>= 5.8.1) System.Security.Cryptography.ProtectedData (>= 4.4) - NuGet.Frameworks (5.8) - NuGet.Packaging (5.8) + NuGet.Frameworks (5.8.1) + NuGet.Packaging (5.8.1) Newtonsoft.Json (>= 9.0.1) - NuGet.Configuration (>= 5.8) - NuGet.Versioning (>= 5.8) - System.Security.Cryptography.Cng (>= 5.0.0-preview.3.20214.6) - System.Security.Cryptography.Pkcs (>= 5.0.0-preview.3.20214.6) - NuGet.Protocol (5.8) - NuGet.Packaging (>= 5.8) - NuGet.Versioning (5.8) + NuGet.Configuration (>= 5.8.1) + NuGet.Versioning (>= 5.8.1) + System.Security.Cryptography.Cng (>= 5.0) + System.Security.Cryptography.Pkcs (>= 5.0) + NuGet.Protocol (5.8.1) + NuGet.Packaging (>= 5.8.1) + NuGet.Versioning (5.8.1) Octokit (0.48) System.Buffers (4.5.1) System.CodeDom (5.0) diff --git a/src/Components/HighlightingProvider.fs b/src/Components/HighlightingProvider.fs deleted file mode 100644 index 3509c15c..00000000 --- a/src/Components/HighlightingProvider.fs +++ /dev/null @@ -1,48 +0,0 @@ -namespace Ionide.VSCode.FSharp - -open Fable.Core.JsInterop -open Fable.Import.vscode - -open DTO -open Ionide.VSCode.Helpers - -module HighlightingProvider = - let private logger = ConsoleAndOutputChannelLogger(Some "HighlightingProvider", Level.DEBUG, None, Some Level.DEBUG) - - let tokenTypes = [| - "comment"; "string"; "keyword"; "number"; "regexp"; "operator"; "namespace"; - "type"; "struct"; "class"; "interface"; "enum"; "enumMember"; "typeParameter"; "function"; - "member"; "macro"; "variable"; "parameter"; "property"; "label"; "variable.readonly.defaultLibrary"; - "property.readonly"; - "mutable"; "disposable"; "cexpr"; |] //Last row - custom F# specific types - - - let provider legend = - { new DocumentSemanticTokensProvider - with - member __.provideDocumentSemanticTokens(textDocument, ct) = - promise { - let builder = SemanticTokensBuilder(legend) - let! res = LanguageService.getHighlighting (textDocument.fileName) - res.highlights - |> Array.sortBy(fun n -> n.range.start.line * 1000000. + n.range.start.character) - |> Array.iter (fun n -> - builder.push(n.range, n.tokenType) - ) - - return builder.build() - } |> unbox - } - - let activate (context : ExtensionContext) = - try - let df = createEmpty - df.language <- Some "fsharp" - - let legend = SemanticTokensLegend(tokenTypes) - languages.registerDocumentSemanticTokensProvider(!!df, provider legend, legend ) |> context.subscriptions.Add - - () - with - | ex -> - logger.Debug("Couldn't activate HighlightingProvider", ex) diff --git a/src/Core/LanguageService.fs b/src/Core/LanguageService.fs index 496889dc..9c3b5345 100644 --- a/src/Core/LanguageService.fs +++ b/src/Core/LanguageService.fs @@ -637,7 +637,6 @@ Consider: opts.synchronize <- Some synch opts.revealOutputChannelOn <- Some Client.RevealOutputChannelOn.Never - opts.initializationOptions <- Some !^(Some initOpts) opts @@ -674,7 +673,10 @@ Consider: let args = [ yield fsautocompletePath - if fsacAttachDebugger then yield "--attachdebugger" + if fsacAttachDebugger + then + yield "--attachdebugger" + yield "--wait-for-debugger" if backgroundSymbolCache then yield "--background-service-enabled" if verbose then yield "--verbose" if fsacSilencedLogs <> null && fsacSilencedLogs.Length > 0 diff --git a/src/Ionide.FSharp.fsproj b/src/Ionide.FSharp.fsproj index 516734d7..00155f52 100644 --- a/src/Ionide.FSharp.fsproj +++ b/src/Ionide.FSharp.fsproj @@ -46,7 +46,6 @@ - diff --git a/src/fsharp.fs b/src/fsharp.fs index 9b7b6018..1b5d291a 100644 --- a/src/fsharp.fs +++ b/src/fsharp.fs @@ -62,7 +62,6 @@ let activate (context : ExtensionContext) : JS.Promise = CodeLensHelpers.activate context FakeTargetsOutline.activate context Gitignore.activate context - HighlightingProvider.activate context FSharpLiterate.activate context PipelineHints.activate context diff --git a/yarn.lock b/yarn.lock index eb33cebb..7e13c44b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -858,10 +858,10 @@ resolved "https://registry.yarnpkg.com/@types/showdown/-/showdown-1.9.3.tgz#eaa881b03a32d3720184731754d3025fc450b970" integrity sha512-akvzSmrvY4J5d3tHzUUiQr0xpjd4Nb3uzWW6dtwzYJ+qW/KdWw5F8NLatnor5q/1LURHnzDA1ReEwCVqcatRnw== -"@types/vscode@^1.48.0": - version "1.48.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.48.0.tgz#c1841ccf80086d53b35a9d7f2eb3b4d949bd2d2f" - integrity sha512-sZJKzsJz1gSoFXcOJWw3fnKl2sseUgZmvB4AJZS+Fea+bC/jfGPVhmFL/FfQHld/TKtukVONsmoD3Pkyx9iadg== +"@types/vscode@^1.52.0": + version "1.52.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.52.0.tgz#61917968dd403932127fc4004a21fd8d69e4f61c" + integrity sha512-Kt3bvWzAvvF/WH9YEcrCICDp0Z7aHhJGhLJ1BxeyNP6yRjonWqWnAIh35/pXAjswAnWOABrYlF7SwXR9+1nnLA== "@types/ws@^7.2.6": version "7.2.6" @@ -2811,6 +2811,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -2929,18 +2936,13 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.1, mkdirp@^0.5.3: +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - mocha@^8.1.3: version "8.1.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.1.3.tgz#5e93f873e35dfdd69617ea75f9c68c2ca61c2ac5" @@ -3604,10 +3606,12 @@ semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.4: + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" serialize-javascript@4.0.0, serialize-javascript@^4.0.0: version "4.0.0" @@ -4105,44 +4109,45 @@ vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -vscode-debugadapter@^1.41.1: - version "1.41.1" - resolved "https://registry.yarnpkg.com/vscode-debugadapter/-/vscode-debugadapter-1.41.1.tgz#4a0433127ad5ac9164e1efae4feaf614ea1a594c" - integrity sha512-GTgbYEmfKlkAAad+7Lv1Hr7FvCzU8BEaYbEaq2/JSkG40GOaAM1ZqIX2gtxjVSk+ClWgDAb8PqQnUyxV+hGqiA== +vscode-debugadapter@^1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/vscode-debugadapter/-/vscode-debugadapter-1.44.0.tgz#3e85f0a41ec61e99e985a3e6a9d41e10d2de8b0b" + integrity sha512-cOYQiDLAdq64rKP1KYcEr7NOlOcNFv13NcW6fCnknX3RR5MKveORKPjgOFFV4HMp04kJ4GtjLm1PFxcrYgg9ZQ== dependencies: - mkdirp "^1.0.4" - vscode-debugprotocol "1.41.0" + mkdirp "^0.5.5" + vscode-debugprotocol "1.44.0" -vscode-debugprotocol@1.41.0: - version "1.41.0" - resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.41.0.tgz#fc99b01dee26e9f25cbb5708318fc0081002808c" - integrity sha512-Sxp7kDDuhpEZiDaIfhM0jLF3RtMqvc6CpoESANE77t351uezsd/oDoqALLcOnmmsDzTgQ3W0sCvM4gErnjDFpA== +vscode-debugprotocol@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.44.0.tgz#79d11844f908cc5104afc303b3780ad2e5fd486a" + integrity sha512-qf+eBnrDyR2MpP08y1JfzJnFZGHdkk86+SRGRp0XepDGNA6n/Nann5XhtAzdGX/yaZokjTAINK313S2yYhHoPQ== -vscode-jsonrpc@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz#9bab9c330d89f43fc8c1e8702b5c36e058a01794" - integrity sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A== +vscode-jsonrpc@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz#108bdb09b4400705176b957ceca9e0880e9b6d4e" + integrity sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg== -vscode-languageclient@^6.1.3: - version "6.1.3" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-6.1.3.tgz#c979c5bb5855714a0307e998c18ca827c1b3953a" - integrity sha512-YciJxk08iU5LmWu7j5dUt9/1OLjokKET6rME3cI4BRpiF6HZlusm2ZwPt0MYJ0lV5y43sZsQHhyon2xBg4ZJVA== +vscode-languageclient@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz#b505c22c21ffcf96e167799757fca07a6bad0fb2" + integrity sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg== dependencies: - semver "^6.3.0" - vscode-languageserver-protocol "^3.15.3" + minimatch "^3.0.4" + semver "^7.3.4" + vscode-languageserver-protocol "3.16.0" -vscode-languageserver-protocol@^3.15.3: - version "3.15.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz#3fa9a0702d742cf7883cb6182a6212fcd0a1d8bb" - integrity sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw== +vscode-languageserver-protocol@3.16.0: + version "3.16.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz#34135b61a9091db972188a07d337406a3cdbe821" + integrity sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A== dependencies: - vscode-jsonrpc "^5.0.1" - vscode-languageserver-types "3.15.1" + vscode-jsonrpc "6.0.0" + vscode-languageserver-types "3.16.0" -vscode-languageserver-types@3.15.1: - version "3.15.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.1.tgz#17be71d78d2f6236d414f0001ce1ef4d23e6b6de" - integrity sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ== +vscode-languageserver-types@3.16.0: + version "3.16.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz#ecf393fc121ec6974b2da3efb3155644c514e247" + integrity sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA== watchpack-chokidar2@^2.0.0: version "2.0.0" @@ -4293,6 +4298,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yargs-parser@13.1.2, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"