mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-23 11:15:27 +00:00
Sync point
This commit is contained in:
parent
3ac2a6b479
commit
c4ad024d3d
3 changed files with 25 additions and 18 deletions
|
@ -1,7 +1,7 @@
|
|||
import { connection, documents } from './server'
|
||||
import { readFileSync } from 'fs'
|
||||
import { conf } from './config'
|
||||
import { serverLog } from './logging'
|
||||
import { readFileSync } from 'fs';
|
||||
import { conf } from './config';
|
||||
import { serverLog } from './logging';
|
||||
import { connection, documents } from './server';
|
||||
|
||||
export function postError(e: Error) {
|
||||
connection.window.showErrorMessage(e.message)
|
||||
|
@ -9,7 +9,11 @@ export function postError(e: Error) {
|
|||
console.log(e)
|
||||
}
|
||||
|
||||
export const formatURI = (uri: string) => uri.replace(/^file:\/\//, '').replace(/^(?:\/)c%3A/, 'C:').replace(/\\/g, '/')
|
||||
export function formatURI(uri: string): string {
|
||||
const drive = uri[7]
|
||||
uri = uri.replace(`file:///${drive.toUpperCase()}%3A`, `file://${drive}:`)
|
||||
return uri.replace(/^file:\/\//, '').replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
export function getDocumentContents(uri: string): string {
|
||||
if (documents.keys().includes('file://' + uri)) return documents.get('file://' + uri).getText()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue