Skip to content

Commit

Permalink
Merge f195840 into 2d57546
Browse files Browse the repository at this point in the history
  • Loading branch information
swernli authored Jul 19, 2024
2 parents 2d57546 + f195840 commit 82e61ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vscode/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
// Licensed under the MIT License.

import { TextDocument, Uri, Range, Location } from "vscode";
import { Utils } from "vscode-uri";
import { ILocation, IRange, IWorkspaceEdit } from "qsharp-lang";
import * as vscode from "vscode";

export const qsharpLanguageId = "qsharp";

// Returns true for all Q# documents, including unsaved files, notebook cells, etc.
export function isQsharpDocument(document: TextDocument): boolean {
return document.languageId === qsharpLanguageId;
return (
document.languageId === qsharpLanguageId &&
(Utils.extname(document.uri) === ".qs" || document.isUntitled) &&
document.uri.scheme !== "git"
);
}

// Returns true for only Q# notebook cell documents.
Expand Down

0 comments on commit 82e61ce

Please sign in to comment.