-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from dylon/dylon/bug-reports
Opens the issue reporter to submit a generated bug report when an internal error is detected.
- Loading branch information
Showing
10 changed files
with
197 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { | ||
Diagnostic, | ||
RenameParams, | ||
WorkspaceEdit, | ||
} from 'vscode-languageserver/node'; | ||
|
||
import { LFortranSettings } from './lfortran-types'; | ||
|
||
export interface BugReportProvider { | ||
getTitle(): string; | ||
getBody(params: object): string; | ||
} | ||
|
||
export class RenameSymbolBugReportProvider implements BugReportProvider { | ||
public params: RenameParams; | ||
public inputText: string; | ||
public workspaceEdit: WorkspaceEdit; | ||
|
||
constructor(params: RenameParams, inputText: string, workspaceEdit: WorkspaceEdit) { | ||
this.params = params; | ||
this.inputText = inputText; | ||
this.workspaceEdit = workspaceEdit; | ||
} | ||
|
||
getTitle(): string { | ||
return "[Generated] LFortranLanguageServer.onRenameRequest rendered invalid text."; | ||
} | ||
|
||
getBody({ version, outputText, diagnostics }: { | ||
version: LFortranSettings, | ||
outputText: string, | ||
diagnostics: Diagnostic[] | ||
}): string { | ||
return ` | ||
The text rendered using the output from \`LFortranLanguageServer.onRenameRequest\` was invalid. Please see the following for more details: | ||
### Input Text | ||
\`\`\`fortran | ||
${this.inputText} | ||
\`\`\` | ||
### Rename Parameters | ||
\`\`\`json | ||
${JSON.stringify(this.params, undefined, 2)} | ||
\`\`\` | ||
### Workspace Edit | ||
\`\`\`json | ||
${JSON.stringify(this.workspaceEdit, undefined, 2)} | ||
\`\`\` | ||
### Output Text | ||
\`\`\`fortran | ||
${outputText} | ||
\`\`\` | ||
### LFortran Diagnostics | ||
\`\`\`json | ||
${JSON.stringify(diagnostics, undefined, 2)} | ||
\`\`\` | ||
### LFortran Version | ||
\`\`\`shell | ||
${version} | ||
\`\`\` | ||
`.trim(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.