예제 #1
0
        internal override RequestId InitializeServer(LSP.Implementation.LanguageClient client)
        {
            var param = UtilInitializeParams.Initialzie();

            param.rootUri          = rootUri.AbsoluteUri;
            param.rootPath         = rootUri.AbsolutePath;
            param.workspaceFolders = new[] { new WorkspaceFolder {
                                                 uri = rootUri.AbsoluteUri, name = "Test-Root"
                                             } };

            if (useMicrosoftPythonLanguageServer)
            {
                /*	Memo: Use only "Microsoft.Python.LanguageServer.";
                 *
                 * */
                var pythonOptions = new Microsoft.Python.LanguageServer.Protocol.PythonInitializationOptions();
                pythonOptions.interpreter            = new Microsoft.Python.LanguageServer.Protocol.PythonInitializationOptions.Interpreter();
                pythonOptions.interpreter.properties = new Microsoft.Python.LanguageServer.Protocol.PythonInitializationOptions.Interpreter.InterpreterProperties();
                pythonOptions.interpreter.properties.InterpreterPath = @"C:\Python39\python.exe";

                /*Memo: 本来ならば"3.9.2"を指定するべきだが、Serverが例外(Unsupported Python version)を返すため"3.8.0"を指定した。
                 *
                 * 以下enumへ3.9の定義を追加することで対応できると思われる。
                 * python-language-server-0.2\src\Parsing\Impl\PythonLanguageVersion.cs
                 * enum PythonLanguageVersion
                 */
                pythonOptions.interpreter.properties.Version = "3.8.0";

                param.initializationOptions = pythonOptions;
            }
            return(client.Send.Initialize(param));
        }
예제 #2
0
        internal virtual RequestId InitializeServer(LSP.Implementation.LanguageClient client)
        {
            var param = UtilInitializeParams.Initialzie();

            param.rootUri          = rootUri.AbsoluteUri;
            param.rootPath         = rootUri.AbsolutePath;
            param.workspaceFolders = new[] { new WorkspaceFolder {
                                                 uri = rootUri.AbsoluteUri, name = "VisualStudio-Solution"
                                             } };
            param.initializationOptions = serverInitializationOptions;
            return(client.Send.Initialize(param));
        }