Skip to content

Commit

Permalink
Style link text + tidy up functions
Browse files Browse the repository at this point in the history
  • Loading branch information
shati-patel committed Dec 14, 2021
1 parent b7f86ae commit 72ff828
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions extensions/ql-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ async function activateWithInstalledDistribution(
void logger.log('Initializing remote queries interface.');
const rqm = new RemoteQueriesManager(ctx, logger, cliServer);

registerTextProvider();
registerRemoteQueryTextProvider();

// The "runRemoteQuery" command is internal-only.
ctx.subscriptions.push(
Expand Down Expand Up @@ -991,7 +991,7 @@ const checkForUpdatesCommand = 'codeQL.checkForUpdatesToCLI';
*
* TODO: Consolidate this with the 'codeql' text provider in query-history.ts.
*/
function registerTextProvider() {
function registerRemoteQueryTextProvider() {
workspace.registerTextDocumentContentProvider('remote-query', {
provideTextDocumentContent(
uri: Uri
Expand Down
28 changes: 14 additions & 14 deletions extensions/ql-vscode/src/remote-queries/view/RemoteQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ export function RemoteQueries(): JSX.Element {
const [repoListExpanded, setRepoListExpanded] = useState(false);
const numOfReposToShow = repoListExpanded ? queryResult.results.length : numOfReposInContractedMode;

try {
const openQueryFile = () => {
vscode.postMessage({
t: 'openFile',
filePath: queryResult.queryFilePath
});
};
const openQueryFile = () => {
vscode.postMessage({
t: 'openFile',
filePath: queryResult.queryFilePath
});
};

const openQueryTextTmpFile = () => {
vscode.postMessage({
t: 'openVirtualFile',
queryText: queryResult.queryText
});
};
const openQueryTextVirtualFile = () => {
vscode.postMessage({
t: 'openVirtualFile',
queryText: queryResult.queryText
});
};

try {
return <div className="vscode-codeql__remote-queries-view">
<h1 className="vscode-codeql__query-title">{queryResult.queryTitle}</h1>

Expand All @@ -94,7 +94,7 @@ export function RemoteQueries(): JSX.Element {
</a>
</span>
<span>{octicons.codeSquare}
<a className="vscode-codeql__query-file-link" href="#" onClick={openQueryTextTmpFile}>
<a className="vscode-codeql__query-file-link" href="#" onClick={openQueryTextVirtualFile}>
query
</a>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
.vscode-codeql__query-file-link {
text-decoration: none;
padding-left: 0.3em;
color: var(--vscode-editor-foreground);
}

.vscode-codeql__query-file-link:hover {
color: var(--vscode-editor-foreground);
}

.vscode-codeql__query-summary-container {
Expand Down

0 comments on commit 72ff828

Please sign in to comment.