Exemple #1
0
        internal override LSP.Implementation.LanguageClient CreateClient()
        {
#if false
            //Memo:問題なく動作する
            var logFilename      = @"D:\temp\LSP-Server\lsp_server_response_pyls.txt";
            var FileName         = Environment.ExpandEnvironmentVariables(@"%HOMEDRIVE%%HOMEPATH%\AppData\Local\vim-lsp-settings\servers\pyls-all\venv\Scripts\pyls.exe");
            var Arguments        = @"-v --log-file D:\temp\LSP-Server\pyls.log";
            var WorkingDirectory = @"";
#elif false
            //Memo:問題なく動作する
            var logFilename      = @"D:\temp\LSP-Server\lsp_server_response_Microsoft_Python.txt";
            var FileName         = Environment.ExpandEnvironmentVariables(@"%HOMEDRIVE%%HOMEPATH%\.vscode\extensions\ms-python.python-2021.5.842923320\languageServer.0.5.59\Microsoft.Python.LanguageServer.exe");
            var Arguments        = @"";
            var WorkingDirectory = @"";
            useMicrosoftPythonLanguageServer = true;
#elif false
            //Memo:問題なく動作する
            var logFilename      = @"D:\temp\LSP-Server\lsp_server_response_pyls-ms.txt";
            var FileName         = Environment.ExpandEnvironmentVariables(@"%HOMEDRIVE%%HOMEPATH%\AppData\Local\vim-lsp-settings\servers\pyls-ms\dotnet.exe");
            var Arguments        = Environment.ExpandEnvironmentVariables(@"%HOMEDRIVE%%HOMEPATH%\AppData\Local\vim-lsp-settings\servers\pyls-ms\Microsoft.Python.LanguageServer.dll");
            var WorkingDirectory = @"";
            useMicrosoftPythonLanguageServer = true;
#elif false
            //Memo:問題なく動作する
            //.NET Runtime version 3.1.15
            //Microsoft.Python.LanguageServer version Latest 0.2
            var logFilename      = @"D:\temp\LSP-Server\lsp_server_response_pyls-ms.txt";
            var FileName         = @"D:\ReferenceSourceCodes\LSP-Server\Servers\python-language-server-0.2\output\bin\Release\dotnet.exe";
            var Arguments        = @"D:\ReferenceSourceCodes\LSP-Server\Servers\python-language-server-0.2\output\bin\Release\Microsoft.Python.LanguageServer.dll";
            var WorkingDirectory = @"";
            useMicrosoftPythonLanguageServer = true;
#elif true
            //Memo:問題なく動作する
            var logFilename      = @"D:\temp\LSP-Server\lsp_server_response_jedi_language_server.txt";
            var FileName         = Environment.ExpandEnvironmentVariables(@"%HOMEDRIVE%%HOMEPATH%\AppData\Local\vim-lsp-settings\servers\jedi-language-server\venv\Scripts\jedi-language-server.exe");
            var Arguments        = @"";
            var WorkingDirectory = Path.GetDirectoryName(sourceUri.AbsolutePath);
#endif

            var client = new LSP.Implementation.LanguageClient();
            client.Start(
                new LSP.Implementation.LanguageClient.LspParameter
            {
                exeFileName         = FileName,
                exeArguments        = Arguments,
                exeWorkingDirectory = WorkingDirectory,
                logger = new Logger(logFilename)
            }
                );
            return(client);
        }
Exemple #2
0
        internal virtual void DidChange(LSP.Implementation.LanguageClient client)
        {
            var text = File.ReadAllText(sourceUri.AbsolutePath, System.Text.Encoding.UTF8);

            ++sourceVersion;//ソースを更新したので+1する

            var param = new DidChangeTextDocumentParams();

            param.contentChanges = new[] { new TextDocumentContentChangeEvent {
                                               text = text
                                           } };
            param.textDocument.uri     = sourceUri.AbsoluteUri;
            param.textDocument.version = sourceVersion;
        }
Exemple #3
0
        internal virtual void InitializedClient(LSP.Implementation.LanguageClient client)
        {
            var param = new InitializedParams();

            client.Send.Initialized(param);
        }