Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all keywords supported #8

Open
trendzetter opened this issue Jul 20, 2023 · 1 comment
Open

Not all keywords supported #8

trendzetter opened this issue Jul 20, 2023 · 1 comment

Comments

@trendzetter
Copy link

trendzetter commented Jul 20, 2023

I added a pact-lsp client to support the pact-lsp server in the Pact for Visual Studio Code (vscode) extension (kadena-community/pact-vscode@916d4c0)

I used a sample lsp extension for vscode and it does work for the functionality show in the screenshots for pact-lsp: completes and hovers for enforce-* , is-charset , read-* , mod, define-* , ..

But some pact keywords appear to be unknown to pact-lsp, some I tested but probably not a complete list: module, defcap, defun, defconst, defschema, deftable, defpact, step, let, let*, property. These are not found for completion and not showing the docs on hover.

My impression is that this is an issue at the lsp server level rather than with the lsp client I added to the pact extension.

This is the debug output when typing (module ) and hovering it:

[Info] Starting server
[Debug] ---> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":2815395,"clientInfo":{"name":"Visual Studio Code","version":"1.80.0"},"locale":"en","rootPath":"/pact","rootUri":"file://pact","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["location.range"]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"didChangeConfiguration":{"dynamicRegistration":true},"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true},"inlineValue":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true},"insertTextMode":2,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode"]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true,"foldingRangeKind":{"valueSet":["comment","imports","region"]},"foldingRange":{"collapsedText":false}},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false,"serverCancelSupport":true,"augmentsSyntaxTokens":true},"linkedEditingRange":{"dynamicRegistration":true},"typeHierarchy":{"dynamicRegistration":true},"inlineValue":{"dynamicRegistration":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":false}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"},"positionEncodings":["utf-16"]},"notebookDocument":{"synchronization":{"dynamicRegistration":true,"executionSummarySupport":true}}},"initializationOptions":[{"pact":"pact"}],"trace":"off","workspaceFolders":[{"uri":"file://pact","name":"pact"}]}}
[Debug] <--2-- {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"callHierarchyProvider":false,"codeActionProvider":false,"colorProvider":false,"completionProvider":{"resolveProvider":false},"declarationProvider":false,"definitionProvider":false,"documentFormattingProvider":false,"documentHighlightProvider":false,"documentR[aDnegbeuFgo]r m-a-t-t>i n{g"Pjrsoovnirdpecr""::"f2a.l0s"e,,""mdeotchuomde"n:t"SiynmibtoilaPlriozveidd"e,r""p:afraalmsse",:"{f}o}l
di[nDgeRbaungg]e P-r-o-v>i d{e"rj"s:ofnarlpsce",:""h2o.v0e"r,P"rmoevtihdoedr""::"ttreuxet,D"oicmupmleenmte/ndtiadtOipoennP"r,o"vpiadrearm"s:"f:a{l"stee,x"trDeofceurmeenncte"s:P{r"ouvriid"e:r""f:iflael:s/e/,/"hroemnea/meemPmrioev/iDdoecru"m:efnatlesne/,k"asdeelneacstwiaopn/Rpaancgte/Ptreosvti.dpearc"t:"f,a"llsaen,g"usaegmeaIndt"i:c"Tpoakcetn"s,P"rvoevrisdieorn""::{1",l"etgeexntd""::"{""}t}o}k
en[MDoedbiufgi]e rVsF"S::[ "odpeecnlianrga tNioornm"a,l"idzeefdiUnriit i5o5n7"5,4"8r5e6a6d3o6n4l7y0"4,0"1s9t7a t"ifci"l,e":d/e/p/rheocmaet/eedm"m,i"ea/bDsotcruamcetn"t,e"na/skyandce"n,a"smwoadpi/fpiaccatt/itoens"t,."pdaocctu"m
entation","defaultLibrary"],"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"]}},"textDocumentSync":{"change":2,"openClose":true,"save":{"includeText":true},"willSave":false,"willSaveWaitUntil":false},"typeDefinitionProvider":false,"workspace":{},"workspaceSymbolProvider":false}}}
[Debug] <--2-- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file://pact/test.pact"}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":2},"contentChanges":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"rangeLength":0,"text":"()"}]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":3},"contentChanges":[{"range":{"start":{"line":0,"character":1},"end":{"line":0,"character":1}},"rangeLength":0,"text":"m"}]}}
[Debug] ---> {"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://pact/test.pact"},"position":{"line":0,"character":2},"context":{"triggerKind":1}}}
[Debug] <--2-- {"id":1,"jsonrpc":"2.0","result":{"isIncomplete":false,"items":[{"label":"make-list"},{"label":"map"},{"label":"minutes"},{"label":"mod"}]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":4},"contentChanges":[{"range":{"start":{"line":0,"character":2},"end":{"line":0,"character":2}},"rangeLength":0,"text":"o"}]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":5},"contentChanges":[{"range":{"start":{"line":0,"character":3},"end":{"line":0,"character":3}},"rangeLength":0,"text":"d"}]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":6},"contentChanges":[{"range":{"start":{"line":0,"character":4},"end":{"line":0,"character":4}},"rangeLength":0,"text":"u"}]}}
[Debug] ---> {"jsonrpc":"2.0","id":2,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://pact/test.pact"},"position":{"line":0,"character":5},"context":{"triggerKind":1}}}
[Debug] <--2-- {"id":2,"jsonrpc":"2.0","result":{"isIncomplete":false,"items":[]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":7},"contentChanges":[{"range":{"start":{"line":0,"character":5},"end":{"line":0,"character":5}},"rangeLength":0,"text":"l"}]}}
[Debug] ---> {"jsonrpc":"2.0","id":3,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://pact/test.pact"},"position":{"line":0,"character":6},"context":{"triggerKind":1}}}
[Debug] <--2-- {"id":3,"jsonrpc":"2.0","result":{"isIncomplete":false,"items":[]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":8},"contentChanges":[{"range":{"start":{"line":0,"character":6},"end":{"line":0,"character":6}},"rangeLength":0,"text":"e"}]}}
[Debug] ---> {"jsonrpc":"2.0","id":4,"method":"textDocument/completion","params":{"textDocument":{"uri":"file://pact/test.pact"},"position":{"line":0,"character":7},"context":{"triggerKind":1}}}
[Debug] <--2-- {"id":4,"jsonrpc":"2.0","result":{"isIncomplete":false,"items":[]}}
[Debug] ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file://pact/test.pact","version":9},"contentChanges":[{"range":{"start":{"line":0,"character":7},"end":{"line":0,"character":7}},"rangeLength":0,"text":" "}]}}
[Debug] ---> {"jsonrpc":"2.0","id":5,"method":"textDocument/hover","params":{"textDocument":{"uri":"file://pact/test.pact"},"position":{"line":0,"character":4}}}
[Debug] <--2-- {"id":5,"jsonrpc":"2.0","result":null}


@rsoeldner
Copy link
Member

rsoeldner commented Jul 20, 2023

@trendzetter that is very true. The LSP server uses the pact executable (pact -b) to get a list of natives (and documentation).

The ones you mentioned aren't part of it. In the long-run we are working on a more enhanced LSP server, including jump to definition etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants