Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dkattan opened this issue Jun 6, 2021 · 1 comment · Fixed by #1500
Closed

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

dkattan opened this issue Jun 6, 2021 · 1 comment · Fixed by #1500
Assignees
Labels
Issue-Enhancement A feature request (enhancement).

Comments

@dkattan
Copy link
Contributor

dkattan commented Jun 6, 2021

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>();
}
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 6, 2021
@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). and removed Needs: Triage Maintainer attention needed! labels Jun 14, 2021
@andyleejordan
Copy link
Member

This seems reasonable to do. Any reason in particular you didn't open a PR for these changes (or those in #1495)?

@andyleejordan andyleejordan self-assigned this Jun 14, 2021
@andyleejordan andyleejordan linked a pull request Jun 15, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants