Skip to content

Commit

Permalink
enable normalizer toggle in abaplint documents (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellourbani authored Nov 22, 2024
1 parent 30b7df2 commit 60a9346
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {BaseLanguageClient} from "vscode-languageclient";
import {ATLASCODEDIFF, CodeNormalizer, getAbapCodeNormalizer, integrationIsActive} from "./integrations";
const ABAPGITSCHEME = "abapgit.normalized";

const fragSchemes = new Set([ATLASCODEDIFF, ABAPGITSCHEME]);

const originalUri = (u:Uri) => {
if (u.scheme !== ABAPGITSCHEME) {return u;}
const {scheme, query} = JSON.parse(u.query);
Expand Down Expand Up @@ -30,7 +32,7 @@ const shouldActivate = (e: TextEditor | undefined) => {
if (!(isdiff && uri)) {return false;}
const relevant =
uri.path.match(/\.abap$/) ||
uri.scheme === ATLASCODEDIFF && uri.fragment.match(/\.abap$/);
fragSchemes.has(uri.scheme) && uri.fragment.match(/\.abap$/);
return relevant && !integrationIsActive(uri);
};

Expand Down

0 comments on commit 60a9346

Please sign in to comment.