Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/client/linters/prospector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ export class Linter extends baseLinter.BaseLinter {
let diagnostics: baseLinter.ILintMessage[] = [];
parsedData.messages.filter((value, index) => index <= this.pythonSettings.linting.maxNumberOfProblems).forEach(msg => {

let sourceLine = txtDocumentLines[msg.location.line - 1];
let lineNumber = msg.location.line === null || isNaN(msg.location.line) ? 1 : msg.location.line;
let sourceLine = txtDocumentLines[lineNumber - 1];
let sourceStart = sourceLine.substring(msg.location.character);
let endCol = txtDocumentLines[msg.location.line - 1].length;
let endCol = txtDocumentLines[lineNumber - 1].length;

// try to get the first word from the starting position
let possibleProblemWords = sourceStart.match(/\w+/g);
Expand All @@ -68,7 +69,7 @@ export class Linter extends baseLinter.BaseLinter {
code: msg.code,
message: msg.message,
column: msg.location.character,
line: msg.location.line,
line: lineNumber,
possibleWord: possibleWord,
type: msg.code,
provider: `${this.Id} - ${msg.source}`
Expand Down