Skip to content

Commit 8c810cf

Browse files
committed
enable semanticTokens and notes
1 parent 37a4d6b commit 8c810cf

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ jobs:
248248
name: Test hls-overloaded-record-dot-plugin test suite
249249
run: cabal test hls-overloaded-record-dot-plugin-tests || cabal test hls-overloaded-record-dot-plugin-tests
250250

251-
- if: matrix.test && matrix.ghc != '9.12'
251+
- if: matrix.test
252252
name: Test hls-semantic-tokens-plugin test suite
253253
run: cabal test hls-semantic-tokens-plugin-tests || cabal test hls-semantic-tokens-plugin-tests
254254

255-
- if: matrix.test && matrix.ghc != '9.12'
255+
- if: matrix.test
256256
name: Test hls-notes-plugin test suite
257257
run: cabal test hls-notes-plugin-tests || cabal test hls-notes-plugin-tests
258258

ghcide/src/Development/IDE/GHC/Compat.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ import Compat.HieUtils
125125
import Control.Applicative ((<|>))
126126
import qualified Data.ByteString as BS
127127
import Data.Coerce (coerce)
128-
import Data.List (foldl')
129128
import qualified Data.Map as Map
130129
import qualified Data.Set as S
131130
import Data.String (IsString (fromString))

ghcide/test/exe/UnitTests.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import System.IO.Extra hiding (withTempDir)
3030
import System.Mem (performGC)
3131
import Test.Hls (GhcVersion (GHC912),
3232
IdeState, def,
33-
knownBrokenForGhcVersions,
33+
ignoreForGhcVersions,
3434
runSessionWithServerInTmpDir,
3535
waitForProgressDone)
3636
import Test.Tasty
@@ -99,7 +99,7 @@ tests = do
9999
let msg = printf "Timestamps do not have millisecond resolution: %dus" resolution_us
100100
assertBool msg (resolution_us <= 1000)
101101
, Progress.tests
102-
, knownBrokenForGhcVersions [GHC912] "referenceImplementation get stuck" FuzzySearch.tests
102+
, ignoreForGhcVersions [GHC912] "Fuzzy search: ignore since referenceImplementation get stuck for ghc912" $ FuzzySearch.tests
103103
]
104104

105105
findResolution_us :: Int -> IO Int

haskell-language-server.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,13 +1744,13 @@ flag semanticTokens
17441744
manual: True
17451745

17461746
common semanticTokens
1747-
if flag(semanticTokens) && impl(ghc < 9.11)
1747+
if flag(semanticTokens) && impl(ghc < 9.13)
17481748
build-depends: haskell-language-server:hls-semantic-tokens-plugin
17491749
cpp-options: -Dhls_semanticTokens
17501750

17511751
library hls-semantic-tokens-plugin
17521752
import: defaults, pedantic, warnings
1753-
if !flag(semanticTokens) || impl(ghc > 9.11)
1753+
if !flag(semanticTokens) || impl(ghc > 9.13)
17541754
buildable: False
17551755
exposed-modules:
17561756
Ide.Plugin.SemanticTokens
@@ -1791,7 +1791,7 @@ library hls-semantic-tokens-plugin
17911791

17921792
test-suite hls-semantic-tokens-plugin-tests
17931793
import: defaults, pedantic, test-defaults, warnings
1794-
if !flag(semanticTokens) || impl(ghc > 9.11)
1794+
if !flag(semanticTokens) || impl(ghc > 9.13)
17951795
buildable: False
17961796
type: exitcode-stdio-1.0
17971797
hs-source-dirs: plugins/hls-semantic-tokens-plugin/test
@@ -1823,13 +1823,13 @@ flag notes
18231823
manual: True
18241824

18251825
common notes
1826-
if flag(notes) && impl(ghc < 9.11)
1826+
if flag(notes) && impl(ghc < 9.13)
18271827
build-depends: haskell-language-server:hls-notes-plugin
18281828
cpp-options: -Dhls_notes
18291829

18301830
library hls-notes-plugin
18311831
import: defaults, pedantic, warnings
1832-
if !flag(notes) || impl(ghc > 9.11)
1832+
if !flag(notes) || impl(ghc > 9.13)
18331833
buildable: False
18341834
exposed-modules:
18351835
Ide.Plugin.Notes
@@ -1857,7 +1857,7 @@ library hls-notes-plugin
18571857

18581858
test-suite hls-notes-plugin-tests
18591859
import: defaults, pedantic, test-defaults, warnings
1860-
if !flag(notes) || impl(ghc > 9.11)
1860+
if !flag(notes) || impl(ghc > 9.13)
18611861
buildable: False
18621862
type: exitcode-stdio-1.0
18631863
hs-source-dirs: plugins/hls-notes-plugin/test

plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Tokenize.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ import qualified Data.Text.Rope as Char
2020
import qualified Data.Text.Utf16.Rope as Utf16
2121
import Data.Text.Utf16.Rope.Mixed (Rope)
2222
import qualified Data.Text.Utf16.Rope.Mixed as Rope
23-
import Development.IDE.GHC.Compat
23+
import Development.IDE.GHC.Compat (HieAST (nodeChildren, nodeSpan, sourcedNodeInfo),
24+
Identifier,
25+
NodeInfo (NodeInfo),
26+
NodeOrigin (SourceInfo),
27+
RealSrcLoc, RealSrcSpan,
28+
SourcedNodeInfo (getSourcedNodeInfo),
29+
nameOccName, occNameString,
30+
realSrcSpanEnd,
31+
realSrcSpanStart, srcLocCol,
32+
srcLocLine, srcSpanEndLine,
33+
srcSpanStartLine)
2434
import Development.IDE.GHC.Error (realSrcSpanToCodePointRange)
2535
import Ide.Plugin.SemanticTokens.Types (HsSemanticTokenType (TModule),
2636
RangeHsSemanticTokenTypes (..))

plugins/hls-semantic-tokens-plugin/test/SemanticTokensTest.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Data.Functor (void)
1010
import qualified Data.List as T
1111
import Data.Map.Strict as Map hiding (map)
1212
import Data.String (fromString)
13-
import Data.Text hiding (length, map,
13+
import Data.Text hiding (length, map, show,
1414
unlines)
1515
import qualified Data.Text as Text
1616
import qualified Data.Text.Utf16.Rope.Mixed as Rope

0 commit comments

Comments
 (0)