Skip to content

Commit

Permalink
Handle embedded-content
Browse files Browse the repository at this point in the history
  • Loading branch information
msaraiva committed Oct 16, 2024
1 parent 1f33c67 commit 56ada7d
Showing 1 changed file with 13 additions and 2 deletions.
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"];

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

0 comments on commit 56ada7d

Please sign in to comment.