Skip to content

CodeActionHandler.cs: FileNotFoundException when using inmemory: protocol #1498

Description

@dkattan

In WorkSpaceService.cs

// List supported schemes here
case"file":
case"untitled":
case"vscode-notebook-cell":
break;

Consider adding

case: "inmemory":

as this is the default for the MonacoLanguageClient

Additionally for this to work, consider the following change to prevent a FileNotFoundException in CodeActionHandler.cs

IReadOnlyDictionary<string,MarkerCorrection>corrections=await_analysisService.GetMostRecentCodeActionsForFileAsync(

IReadOnlyDictionary<string, MarkerCorrection> corrections = null;
try
{
var file = _workspaceService.GetFile(request.TextDocument.Uri);
corrections = await _analysisService.GetMostRecentCodeActionsForFileAsync(file).ConfigureAwait(false);
}
catch (Exception ex) //if (corrections == null)
{
return Array.Empty<CommandOrCodeAction>();
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions