Skip to content

Commit

Permalink
fix(ls): replace legacy buildJsonPointer with apidom-json-pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Jul 24, 2023
1 parent 3a1d75c commit 70a359f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/apidom-ls/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
StringElement,
traverse,
} from '@swagger-api/apidom-core';
import { compile } from '@swagger-api/apidom-json-pointer';
import { TextDocument } from 'vscode-languageserver-textdocument';
import { Range } from 'vscode-languageserver-types';

Expand Down Expand Up @@ -184,8 +185,8 @@ export function logJson(label: string, message: unknown): void {
}

export function buildJsonPointer(path: string[]): string {
const jsonPointer = path.map((s) => s.replaceAll('/', '~1')).join('/');
return `#/${jsonPointer}`;
const jsonPointer = compile(path);
return `#${jsonPointer}`;
}

interface FoundNode {
Expand Down

0 comments on commit 70a359f

Please sign in to comment.