Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.4.0

- Answer textDocument/documentSymbol for a notebook, which came back empty because every cell symbol hangs off the projection's synthetic class

## 0.1.3.0

- Write the shadow document to disk before the server is told about it, which jdtls needs to answer a goto
Expand Down
2 changes: 1 addition & 1 deletion java-notebook-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: java-notebook-language-server
version: 0.1.3.0
version: 0.1.4.0
build-type: Simple
extra-source-files:
README.md
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: java-notebook-language-server
version: 0.1.3.0
version: 0.1.4.0

extra-source-files:
- README.md
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ system-ghc: true

extra-deps:
- git: https://github.com/codedownio/notebook-language-server-core.git
commit: 7ad5b8aa8f48a608ff1706f1441846d2d1ef3033
commit: 097e5461f2908dcb12d110b2fa015be96df5b9db

- git: https://github.com/codedownio/sandwich
# long-running-nodes branch
Expand Down
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

packages:
- completed:
commit: 7ad5b8aa8f48a608ff1706f1441846d2d1ef3033
commit: 097e5461f2908dcb12d110b2fa015be96df5b9db
git: https://github.com/codedownio/notebook-language-server-core.git
name: notebook-language-server-core
pantry-tree:
sha256: 8efdde8eaa3ff74536df7db3078f57ac5af00606b9129e48e576b37fffe030da
size: 3032
sha256: 655551f233c4e1a8e3b9b53628174b588fc1c4db06c4786bfb3a54098600522a
size: 3264
version: 0.1.0.0
original:
commit: 7ad5b8aa8f48a608ff1706f1441846d2d1ef3033
commit: 097e5461f2908dcb12d110b2fa015be96df5b9db
git: https://github.com/codedownio/notebook-language-server-core.git
- completed:
commit: c3e16ccda384917fba1ccc5f3cf8f592415562c1
Expand Down
19 changes: 18 additions & 1 deletion test/Test/Notebook.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Control.Lens ((^.))
import Data.String.Interpolate
import Data.Text (Text)
import qualified Data.Text as T
import Language.LSP.Protocol.Lens (label, message, range)
import Language.LSP.Protocol.Lens (label, message, name, range)
import Language.LSP.Protocol.Types
import Test.Sandwich
import Test.Sandwich.Contexts.Files
Expand Down Expand Up @@ -101,3 +101,20 @@ spec = describe "Notebook" $ do
case [d ^. range | d <- diagnostics, "never used" `T.isInfixOf` (d ^. message)] of
(r : _) -> r `shouldBe` Range (Position 0 7) (Position 0 21)
[] -> expectationFailure [i|No unused-import diagnostic in: #{diagnostics}|]

-- jdtls answers with the projection's tree: everything hangs off the synthetic __Cells
-- class, which spans lines no cell owns. Core replaces a node it can't place with its
-- children, so the method surfaces at the top rather than the whole outline vanishing.
it "outlines a method declared in the notebook" $ do
doNotebookSession cells $ \(Helpers.LspSessionInfo {..}) -> do
doc <- LSP.openDoc lspSessionInfoFileName LanguageKind_Java

waitUntil 300 $ do
symbols <- LSP.getDocumentSymbols doc
info [i|Got document symbols: #{symbols}|]
case symbols of
Right documentSymbols ->
[(s ^. name, s ^. range) | s <- documentSymbols]
`listShouldContain` ("doubled(int)", Range (Position 4 0) (Position 6 1))
Left symbolInformations ->
expectationFailure [i|Expected a document symbol tree, got: #{symbolInformations}|]
Loading