Closed GNSubrahmanyam closed 4 years ago
Suddenly i am getting this error
@filipw Any update on this? As csharp lsp was working fine. Suddenly i am getting this issue. How can i fix it?
it should fall back to current directory if you don't pass the path. looks like you are passing a path that doesn't exist? https://github.com/OmniSharp/omnisharp-roslyn/blob/7f5abf131e286331a51f4554febb43561ea5b663/src/OmniSharp.Host/Services/OmniSharpEnvironment.cs#L22-L39
@filipw Thanks! I will check my code and get back to you.
@filipw I am sending workspace path.
I am using omnisharp-roslyn v1.35.1 and donet core https://dotnet.microsoft.com/download/dotnet-core/3.1 SDK 3.1.202 linux X64
@filipw Any updates?
looks like the LSP update caused this? https://github.com/OmniSharp/omnisharp-roslyn/pull/1791 maybe @razzmatazz knows more
I think you need to open the bug here https://github.com/OmniSharp/csharp-language-server-protocol/pull/230 it's probably this PR in the csharp-language-server-protocol that broke it
looks like the LSP update caused this? OmniSharp/omnisharp-roslyn#1791 maybe @razzmatazz knows more
@GNSubrahmanyam are you using omnisharp-roslyn built from master branch (from source?)
You mentioned that you are using v1.35.1
. Changes from OmniSharp/omnisharp-roslyn#1791 have not been released with v1.35.2 yet (there is no such release ATM)
@razzmatazz I am using https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.35.1/omnisharp.http-linux-x64.tar.gz and https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.202-linux-x64-binaries
Do you want see my docker file?
@GNSubrahmanyam do you have an idea of what could've triggered the change in behaviour? Have you updated your editor by chance?
Right now i am using.
"monaco-editor": "^0.20.0",
"monaco-languageclient": "^0.13.0",
Also i tried with but it is not working
"monaco-editor": "^0.19.3",
"monaco-languageclient": "^0.12.0",
logs
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"clientInfo":{"name":"vscode"},"rootPath":"/workspace/gnsubrahmanyam-54226dbe/Source.cs","rootUri":"file:///workspace/gnsubrahmanyam-54226dbe/Source.cs","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":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]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"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]}},"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]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":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},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":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},"declaration":{"dynamicRegistration":true,"linkSupport":true}}},"trace":"off","workspaceFolders":[{"uri":"file:///workspace/gnsubrahmanyam-54226dbe/Source.cs","name":"file:///workspace/gnsubrahmanyam-54226dbe/Source.cs"}]}}
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Finding descriptor for initialize"}}
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Starting: Routing Request (0) initialize"}}
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Converting params for Request (0) initialize to OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams"}}
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"Failed to handle notification initialize - System.ArgumentException: OmniSharp only supports being launched with a directory path or a path to a solution (.sln) file.\nParameter name: path\n at OmniSharp.Services.OmniSharpEnvironment..ctor (System.String path, System.Int32 hostPid, Microsoft.Extensions.Logging.LogLevel logLevel, System.String[] additionalArguments) [0x00062] in <af73e6dd2119447d987570341b94877c>:0 \n at OmniSharp.LanguageServerProtocol.LanguageServerHost.CreateCompositionHost (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00048] in <233112e629fc48e0b2c6db225a6abcb6>:0 \n at OmniSharp.LanguageServerProtocol.LanguageServerHost.Initialize (OmniSharp.Extensions.LanguageServer.Server.ILanguageServer server, OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00000] in <233112e629fc48e0b2c6db225a6abcb6>:0 \n at OmniSharp.Extensions.LanguageServer.Server.LanguageServer+<>c__DisplayClass59_0.<OmniSharp.Extensions.Embedded.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle>b__0 (OmniSharp.Extensions.LanguageServer.Server.InitializeDelegate c) [0x00000] in <12a97e97079c4b10a770c2869fa566a9>:0 \n at System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () [0x00048] in <59093ef301a24e5a91cb0295fb832cca>:0 \n at System.Threading.Tasks.Task.WhenAll (System.Collections.Generic.IEnumerable`1[T] tasks) [0x000ba] in <a1ae6166591d4020b810288d19af38d4>:0 \n at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.OmniSharp.Extensions.Embedded.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams request, System.Threading.CancellationToken token) [0x001a1] in <12a97e97079c4b10a770c2869fa566a9>:0 \n at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, OmniSharp.Extensions.Embedded.MediatR.RequestHandlerDelegate`1[TResponse] next) [0x000e1] in <12a97e97079c4b10a770c2869fa566a9>:0 \n at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1[TDescriptor].RouteRequest (TDescriptor descriptor, OmniSharp.Extensions.JsonRpc.Server.Request request, System.Threading.CancellationToken token) [0x0038a] in <709d80c63bce4fcd8b1071c79413b97b>:0 "}}
{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Finished: Routing Request (0) initialize in 289ms"}}
{"jsonrpc":"2.0","id":"0","error":{"code":-32602,"message":"Internal Error - System.ArgumentException: OmniSharp only supports being launched with a directory path or a path to a solution (.sln) file.\nParameter name: path\n at OmniSharp.Services.OmniSharpEnvironment..ctor (System.String path, System.Int32 hostPid, Microsoft.Extensions.Logging.LogLevel logLevel, System.String[] additionalArguments) [0x00062] in <af73e6dd2119447d987570341b94877c>:0 \n at OmniSharp.LanguageServerProtocol.LanguageServerHost.CreateCompositionHost (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00048] in <233112e629fc48e0b2c6db225a6abcb6>:0 \n at OmniSharp.LanguageServerProtocol.LanguageServerHost.Initialize (OmniSharp.Extensions.LanguageServer.Server.ILanguageServer server, OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00000] in <233112e629fc48e0b2c6db225a6abcb6>:0 \n at OmniSharp.Extensions.LanguageServer.Server.LanguageServer+<>c__DisplayClass59_0.<OmniSharp.Extensions.Embedded.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle>b__0 (OmniSharp.Extensions.LanguageServer.Server.InitializeDelegate c) [0x00000] in <12a97e97079c4b10a770c2869fa566a9>:0 \n at System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () [0x00048] in <59093ef301a24e5a91cb0295fb832cca>:0 \n at System.Threading.Tasks.Task.WhenAll (System.Collections.Generic.IEnumerable`1[T] tasks) [0x000ba] in <a1ae6166591d4020b810288d19af38d4>:0 \n at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.OmniSharp.Extensions.Embedded.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams request, System.Threading.CancellationToken token) [0x001a1] in <12a97e97079c4b10a770c2869fa566a9>:0 \n at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, OmniSharp.Extensions.Embedded.MediatR.RequestHandlerDelegate`1[TResponse] next) [0x000e1] in <12a97e97079c4b10a770c2869fa566a9>:0 \n at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1[TDescriptor].RouteRequest (TDescriptor descriptor, OmniSharp.Extensions.JsonRpc.Server.Request request, System.Threading.CancellationToken token) [0x0038a] in <709d80c63bce4fcd8b1071c79413b97b>:0 "}}
{"jsonrpc":"2.0","id":1,"method":"shutdown","params":null}
{"jsonrpc":"2.0","error":{"code":-32002,"message":"Server Not Initialized"}}
ah you are right, I thought we shipped it already 🙈
I tried with
"monaco-editor": "^0.19.3",
"monaco-languageclient": "^0.12.0",
and It's working
FROM node:8.16.0-stretch-slim
# Omnisharp
ENV OMNISHARP_VERSION 1.34.15
RUN curl -L -o omnisharp.tar.gz https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v$OMNISHARP_VERSION/omnisharp-linux-x64.tar.gz
RUN curl -L -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/43f3a3bd-3df2-41e6-beca-3ec4952ca6c4/30fe7779249607d1bb3bb4b20d61a479/dotnet-sdk-3.0.103-linux-x64.tar.gz
RUN mkdir -p /opt/dotnet && tar -zxf dotnet.tar.gz -C /opt/dotnet
RUN mkdir -p /opt/omnisharp && tar -zxf omnisharp.tar.gz -C /opt/omnisharp
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu57 \
liblttng-ust0 \
libssl1.0.2 \
libstdc++6 \
zlib1g \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /opt/dotnet/dotnet /usr/bin/dotnet
ENV DOTNET_RUNNING_IN_CONTAINER=true \
NUGET_XMLDOC_MODE=skip \
DOTNET_USE_POLLING_FILE_WATCHER=true
# Trigger first run experience by running arbitrary cmd to populate local package cache
RUN dotnet help
but it is not working with
"monaco-editor": "^0.20.0",
"monaco-languageclient": "^0.13.0",
FROM ubuntu:18.04
# Omnisharp
ENV OMNISHARP_VERSION 1.34.15
RUN curl -L -o omnisharp.tar.gz https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v$OMNISHARP_VERSION/omnisharp-linux-x64.tar.gz
RUN curl -L -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/43f3a3bd-3df2-41e6-beca-3ec4952ca6c4/30fe7779249607d1bb3bb4b20d61a479/dotnet-sdk-3.0.103-linux-x64.tar.gz
@razzmatazz @filipw Any update? What would be the reason.
Even i tried this is also not working
FROM ubuntu:18.04
# Omnisharp version
ENV OMNISHARP_VERSION 1.34.9
RUN wget -c https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v$OMNISHARP_VERSION/omnisharp-linux-x64.tar.gz -O omnisharp.tar.gz
RUN wget -c https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet.tar.gz
@filipw @razzmatazz Whenever client open we dynamically creates workspace under /workspace/workspacename/ in this case it is not working.
How can i initiate workspace dynamically.
@razzmatazz
i tried doing omnisharp/run -s /workspace/username-projectid/ -lsp
still it is not working. Our production release is blocked because of this.
Moving this issue here, since it seems to be LSP related. Looks like RootUri is null (?)
apparently it works with
"monaco-editor": "^0.19.3",
"monaco-languageclient": "^0.12.0",
but not
"monaco-editor": "^0.20.0",
"monaco-languageclient": "^0.13.0",
cc @david-driscoll @TylerLeonhardt
@filipw Also it not working with any editors
i tried doing omnisharp/run -s /workspace/username-projectid/ -lsp
still it is not working. Our production release is blocked because of this.
Whenever client open we dynamically creates workspace under /workspace/workspacename/ in this case it is not working.
How can i initiate workspace dynamically.
That's odd. The PowerShell extension works when RootUri is null. Extensions are the ones that should handle that:
It's usually what happens when you have multiple workspaces or no workspace AFAIK.
Any updates ? How can i fix it?
@razzmatazz Any updates?
still this is not fixed
message: "Failed to handle notification initialize - System.ArgumentException: OmniSharp only supports being launched with a directory path or a path to a solution (.sln) file.↵Parameter name: path↵ at OmniSharp.Services.OmniSharpEnvironment..ctor (System.String path, System.Int32 hostPid, Microsoft.Extensions.Logging.LogLevel logLevel, System.String[] additionalArguments) [0x00062] in <794013c6a6c5442b833dd5811946393a>:0 ↵ at OmniSharp.LanguageServerProtocol.LanguageServerHost.CreateCompositionHost (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00048] in 2[TSource,TResult].MoveNext () [0x00048] in <59093ef301a24e5a91cb0295fb832cca>:0 ↵ at System.Threading.Tasks.Task.WhenAll (System.Collections.Generic.IEnumerable
1[T] tasks) [0x000ba] in 2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, MediatR.RequestHandlerDelegate
1[TResponse] next) [0x000e1] in <72d5c645fd274cab83fd1f12f360a92e>:0 ↵ at MediatR.Pipeline.RequestPostProcessorBehavior2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, MediatR.RequestHandlerDelegate
1[TResponse] next) [0x0007e] in 2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, MediatR.RequestHandlerDelegate
1[TResponse] next) [0x0013e] in
Usage:
const lspProcess = { processName: 'csharp', command: '/opt/omnisharp/run', args: ['-s', ${path.resolve(/workspace/${userName}-${uniqueSlug}/)},'-lsp', '-debug'] }
https://github.com/TypeFox/monaco-languageclient/blob/master/example/src/json-server-launcher.ts#L19
const serverConnection = server.createServerProcess(lspProcess.processName, lspProcess.command, lspProcess.args)
I fixed this issue. Workspace path was wrong. Thanks
Ubuntu 18.04 Environment docker Client: Monaco-languageclient