Linting of all currently discovered files that contain the edited include at some depth is pretty much working! Issue #11 highlights the blocking bug

This commit is contained in:
Noah Santschi-Cooney 2018-07-25 00:43:07 +01:00
parent 5e6a12c88b
commit 5a06d8ff1b
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48
3 changed files with 58 additions and 30 deletions

View file

@ -1,8 +1,14 @@
import { connection } from './server'
import { connection, documents } from './server'
import { readFileSync } from 'fs'
export function postError(e: Error) {
connection.window.showErrorMessage(e.message)
console.log(e)
}
export const formatURI = (uri: string) => uri.replace(/^file:\/\//, '').replace(/^(?:\/)c%3A/, 'C:').replace(/\\/g, '/')
export const formatURI = (uri: string) => uri.replace(/^file:\/\//, '').replace(/^(?:\/)c%3A/, 'C:').replace(/\\/g, '/')
export function getDocumentContents(uri: string): string {
if (documents.keys().includes('file://' + uri)) return documents.get('file://' + uri).getText()
else return readFileSync(uri).toString()
}