Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Raoul Wols
    @rwols
    in any case just check your sys.path in a python interpreter and compare against your %PATH%
    Frank Berthold
    @fkberthold
    @tomv564 , @rwols That's exactly what I needed. Thank you both. I'd made the mistaken assumption that pyls was being treated as a module and what it was failing to find was python. Thank you again for the help.
    YE, Chenhao
    @Ye-Chenhao
    Last time when I update to macOS Mojave, LSP clangd cannot find header file.
    It is then fixed by "open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg"
    I just update to macOS Catalina today, a similar issue occurs.
    but I cannot find similar pkg to fix the problem
    any idea how to do that in Catalina?
    it seems Apple is not supportive for that ...
    Tom van Ommeren
    @tomv564
    Thanks a ton for sharing - @rwols should we add this to our c++ guide ? Is this new include path something CMake would "automatically" fix in the future?
    Raoul Wols
    @rwols
    Since apple wants to use clangd for Xcode, there might be a chance that there’s already a correctly set up clangd executable somewhere in the new Xcode sdk? I haven’t checked though. If not, we’ll have to figure out to get around yet another apple annoyance :)
    I haven’t upgraded to Catalina yet as I’m doing lots of work on Ubuntu lately but I’ll investigate in the coming days
    Ryan's Archive
    @genericptr
    So LSP upon initialization has these synchronize params:
    "synchronization" : {
    "didSave" : true
    },
    regardless I filled out my response with:
    "textDocumentSync" : {
    "openClose" : true,
    "change" : 2,
    "willSave" : true,
    "save" : {
    "includeText" : true
    }
    }
    LSP does in fact returns all these messages with the exception of "textDocument/didChange" which always returns the entire document text (in "contentChanges"), regardless of the "change" key which I set to TextDocumentSyncKind.Incremental (integer with value of 2)
    My questions is, does LSP respect the incremental change capability?
    The other potential bug is saving. Here's my response message from LSP
    {
    "method" : "textDocument/didSave",
    "jsonrpc" : "2.0",
    "params" : {
    "textDocument" : {
    "uri" : "file:///Users/ryanjoseph/Desktop/FPCLS-Test/parser_test.pas"
    }
    }
    }
    I set the "includeText" to true so I expected there to be some text returned in the message. Not a big deal because but I wanted to verify this is working correctly.
    Ryan's Archive
    @genericptr
    one more question: what does "signatureHelpProvider" do? I enabled it in the initialize response but I don't see any messages getting send from LSP. The docs say "The signature help request is sent from the client to the server to request signature information at a given cursor position."
    I enabled it with "signatureHelpProvider" : {} because the trigger characters were optional and I don't know what the feature does anyways.
    Raoul Wols
    @rwols
    @genericptr signature help is information about function parameters. If your language has function overloads, your server can return multiple results, one for each overload. You should provide a trigger character, and then this plugin will do the request once the caret is to the right of one of the trigger chars. For example, in python, we request signature help for the characters ( and , (comma). Eventually this should result in a pop up under the caret that should help the user type out the arguments to a function call.
    @genericptr about the doc sync: it is up the text editor to decide what kind of doc sync is applied. We choose “full” instead of “incremental”, because the sublime text api does not provide “incremental”.
    Ryan's Archive
    @genericptr
    Thanks Raoul, the docs didn't explain what that trigger character was.
    As for the sync that's kind of problem that may be a deal breaker. Does that mean every time you type a single character the ENTIRE document will be sent? Some of these files we work on are 100k+ and require some processing to remove the escape characters not to mention passing through the socket.
    Ryan's Archive
    @genericptr
    Why can't ST return incremental changes? There's not a text changed callback?
    Ryan's Archive
    @genericptr
    Yes, you're right, the ST API doesn't tell you what range of text changes! That's pathetic they can't provide this simple thing and make language servers burn CPU processing all this stuff. I'm going to make a feature request but these kinds of things make me want to give up the editor. Sorry, venting. ;) I invested lots into ST and I don't want to bail to VSCode.
    Tom van Ommeren
    @tomv564
    Good to hear you made some progress @genericptr !
    An additional note on incremental sync: It's still an open issue on our repo (there might be a way to solve it elegantly). Two other reasons it hasn't been actively pursued:
    • Don't know the actual cost of sending "reasonable" sized files over stdio/tcp - if you want to help by measuring that would be much appreciated!
    • A number of servers are unable to partially update their ASTs (they re-parse the whole file after a single-char change), further reducing the "win" of partial updates.
    Tom van Ommeren
    @tomv564
    LSP doesn't send willSave, and we don't send text on didSave because so far most servers have gotten the info they need from didChange.
    Ryan's Archive
    @genericptr
    Before I knew about Language Server Protocol I had envisioned something similar so I asked the ST forums if it was possible given their API (they mentioned LSP at this point and I switched plans). They suggested to manually calculate diffs (like git does) because ST doesn't support that API (see my post https://forum.sublimetext.com/t/project-based-completions-snippets/45689/4). Doing that is probably just as slow if not slower.
    I'll take some metrics but we're talking about sending 100k+ files and then decoding the JSON string (unescaping characters) every single key press. I'll make another feature request for their API but the ST team doesn't tend to make many updates so I don't expect it to be fixed.
    Ryan's Archive
    @genericptr
    @tomv564 As a solution to work around ST but be outside the protocol maybe consider memory mapped files. If the incremental change message contained a path to a memory mapped file then we could use this instead.
    Ryan's Archive
    @genericptr
    Another request to make this process more efficient. Could LSP return the current syntax scope in the changes notification?
    Ryan's Archive
    @genericptr
    Request #2: could LSP return the settings in the ST project to the server or at least return the path of the .sublime-project? I wanted to keep some preferences for the server but there's no way to get them from ST.
    As per my feature request they claim there's a limited method you can use to get text changes (https://forum.sublimetext.com/t/retrieving-inserted-and-deleted-text/18697). Does this look viable? Maybe at the very least single keystrokes could be sent as deltas but pasting, or deleting ranges would result in the sending the entire document. It's at least something.
    Tom van Ommeren
    @tomv564
    Request 1: No (not in the protocol). Request 2: See workspace/didChangeConfiguration or workspace/configuration.
    Ryan's Archive
    @genericptr
    Thanks Tom. Btw, just curious, what is codeLensProvider in the protocol? I'm thinking the "peek definition" in VSCode but I don't think it's implemented in LSP
    Raoul Wols
    @rwols
    I'm not sure either what codelens is supposed to be but I too think that it's supposed to be "peek" from visual studio. In that case I don't think we need it in sublime text as we are all experts with "CTRL+P + @ def" of course :)
    Ryan's Archive
    @genericptr
    Peek is actually kind of nice but it overlaps with showing the declaration at hover. I personally think it should be implemented.
    Raoul Wols
    @rwols
    do you have examples of servers that implement codelens?
    Ryan's Archive
    @genericptr
    Just looking at VSCode now the interfaces allows for some scrolling of the document in the popup. THat's pretty useful but not sure how well it could be implemented with ST.
    Screen Shot 2019-10-13 at 5.23.31 PM.png
    Here's a screenshot
    notice it shows the document in the popup and you can do some scrolling also to see the context
    Rafał Chłodnicki
    @rchl
    Hey. I'd like to suggest creating LSP-eslint package since all needed for https://github.com/microsoft/vscode-eslint to work is now supported
    directed mostly at @predragnikolic