Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { ThemeProvider } from '@primer/react';

import CodePaths from '../../view/remote-queries/CodePaths';
import { CodePaths } from '../../view/common';
import type { CodeFlow } from '../../remote-queries/shared/analysis-result';

export default {
Expand Down Expand Up @@ -112,8 +112,8 @@ PowerShell.args = {
message: {
tokens: [
{
type: 'text',
t: 'This zip file may have a dangerous path'
t: 'text',
text: 'This zip file may have a dangerous path'
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { ComponentStory, ComponentMeta } from '@storybook/react';

import FileCodeSnippet from '../../view/remote-queries/FileCodeSnippet';
import { FileCodeSnippet } from '../../view/common';

export default {
title: 'File Code Snippet',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { VSCodeDropdown, VSCodeLink, VSCodeOption, VSCodeTag } from '@vscode/web
import * as React from 'react';
import { ChangeEvent, useRef, useState } from 'react';
import styled from 'styled-components';
import { CodeFlow, AnalysisMessage, ResultSeverity } from '../../remote-queries/shared/analysis-result';
import { SectionTitle, VerticalSpace } from '../common';
import FileCodeSnippet from './FileCodeSnippet';
import { CodeFlow, AnalysisMessage, ResultSeverity } from '../../../remote-queries/shared/analysis-result';
import { SectionTitle } from '../SectionTitle';
import { VerticalSpace } from '../VerticalSpace';
import { FileCodeSnippet } from '../FileCodeSnippet';

const StyledCloseButton = styled.button`
position: absolute;
Expand Down Expand Up @@ -111,7 +112,7 @@ const Menu = ({
</VSCodeDropdown>;
};

const CodePaths = ({
export const CodePaths = ({
codeFlows,
ruleDescription,
message,
Expand Down Expand Up @@ -173,5 +174,3 @@ const CodePaths = ({
</div>
);
};

export default CodePaths;
1 change: 1 addition & 0 deletions extensions/ql-vscode/src/view/common/CodePaths/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './CodePaths';
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import styled from 'styled-components';
import { CodeSnippet, FileLink, HighlightedRegion, AnalysisMessage, ResultSeverity } from '../../remote-queries/shared/analysis-result';
import { createRemoteFileRef } from '../../pure/location-link-utils';
import { parseHighlightedLine, shouldHighlightLine } from '../../pure/sarif-utils';
import { CodeSnippet, FileLink, HighlightedRegion, AnalysisMessage, ResultSeverity } from '../../../remote-queries/shared/analysis-result';
import { createRemoteFileRef } from '../../../pure/location-link-utils';
import { parseHighlightedLine, shouldHighlightLine } from '../../../pure/sarif-utils';
import { VSCodeLink } from '@vscode/webview-ui-toolkit/react';
import { VerticalSpace } from '../common';
import { VerticalSpace } from '../VerticalSpace';

const borderColor = 'var(--vscode-editor-snippetFinalTabstopHighlightBorder)';
const warningColor = '#966C23';
Expand Down Expand Up @@ -193,7 +193,7 @@ const Line = ({
</div>;
};

const FileCodeSnippet = ({
export const FileCodeSnippet = ({
fileLink,
codeSnippet,
highlightedRegion,
Expand Down Expand Up @@ -257,5 +257,3 @@ const FileCodeSnippet = ({
</Container>
);
};

export default FileCodeSnippet;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './FileCodeSnippet';
2 changes: 2 additions & 0 deletions extensions/ql-vscode/src/view/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export * from './icon';
export * from './CodePaths';
export * from './FileCodeSnippet';
export * from './HorizontalSpace';
export * from './SectionTitle';
export * from './VerticalSpace';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import { AnalysisAlert } from '../../remote-queries/shared/analysis-result';
import CodePaths from './CodePaths';
import FileCodeSnippet from './FileCodeSnippet';
import { CodePaths, FileCodeSnippet } from '../common';

const AnalysisAlertResult = ({ alert }: { alert: AnalysisAlert }) => {
const showPathsLink = alert.codeFlows.length > 0;
Expand Down