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
15 changes: 13 additions & 2 deletions src/languageClientManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,21 @@ import {
reporter,
} from "./telemetry";

const languageIds = ["elixir", "eex", "html-eex", "phoenix-heex", "surface"];
// Languages fully handled by this extension
const languageIds = ["elixir", "eex", "html-eex", "phoenix-heex"];

// Template languages handled by their own extensions but require activation of this
// one for compiler diagnostics. Template languages that compile down to Elixir AST
// and embed other languages (e.g. HTML, CSS, JS and Elixir itself), should be moved
// here for proper language service forwarding via "embedded-content".
const templateLanguageIds = ["surface"];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"html-eex" and "phoenix-heex" should eventually be moved here.


const activationLanguageIds = languageIds.concat(templateLanguageIds);

const defaultDocumentSelector = languageIds.flatMap((language) => [
{ language, scheme: "file" },
{ language, scheme: "untitled" },
{ language, scheme: "embedded-content" },
]);

const untitledDocumentSelector = languageIds.map((language) => ({
Expand Down Expand Up @@ -348,7 +359,7 @@ export class LanguageClientManager {
context: vscode.ExtensionContext,
) {
// We are only interested in elixir related files
if (!languageIds.includes(document.languageId)) {
if (!activationLanguageIds.includes(document.languageId)) {
return;
}

Expand Down
Loading