Skip to content

Commit

Permalink
fix: file path parsing in sany output
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsonf committed Aug 27, 2024
1 parent 0cce9ac commit c497f6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@
],
"main": "./out/main.js",
"browser": "./out/main.browser.js",
"files": [
"resources",
"tools"
],
"contributes": {
"terminal": {
"profiles": [
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/sany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class SanyStdoutParser extends ProcessOutputHandler<SanyData> {
}

private tryParseModulePath(line: string) {
const rxJarPath = /^(.*)(?: \(jar:file:.*\))$/g;
const rxJarPath = /^(.*)(?: \(.*\))$/g;
const jarPathMatches = rxJarPath.exec(line);
const modPath = jarPathMatches ? jarPathMatches[1] : line;
this.rememberParsedModule(modPath);
Expand Down
6 changes: 4 additions & 2 deletions src/webview/checkResultView/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ export const EmptyLine = () => <div style={{marginTop: '1em'}}/>;

interface CodeRangeLinkI {line: string, filepath: string | undefined, range: Range}
export const CodeRangeLink = React.memo(({line, filepath, range}: CodeRangeLinkI) => (
(!filepath || !range) ? (null) : <CodePositionLink line={line} filepath={filepath} position={range[0]}/>
(!filepath || !range)
? <>{line}</>
: <CodePositionLink line={line} filepath={filepath} position={range[0]}/>
));

interface CodePositionLinkI {line: string, filepath: string | undefined, position: Position | undefined}
export const CodePositionLink = React.memo(({line, filepath, position}: CodePositionLinkI) => {
if (!filepath || !position) {
return (null);
return (<>{line}</>);
}

const location = {'line': position.line, 'character': position.character};
Expand Down

0 comments on commit c497f6e

Please sign in to comment.