11import { ApplicationError } from '@theia/core' ;
2- import URI from '@theia/core/lib/common/uri' ;
3- import {
4- Location ,
5- Range ,
6- } from '@theia/core/shared/vscode-languageserver-protocol' ;
2+ import { Location } from '@theia/core/shared/vscode-languageserver-protocol' ;
73import { BoardUserField } from '.' ;
84import { Board , Port } from '../../common/protocol/boards-service' ;
95import { ErrorInfo as CliErrorInfo } from '../../node/cli-error-parser' ;
@@ -28,31 +24,6 @@ export namespace CoreError {
2824 const { message, location } = error ;
2925 return ! ! message && ! ! location ;
3026 }
31- export function toString ( { location, message } : Compiler ) : string {
32- const {
33- uri,
34- range : {
35- start : { line, character } ,
36- } ,
37- } = location ;
38- return `${ new URI ( uri )
39- . withFragment ( `L${ line } ,${ character } ` )
40- . toString ( ) } => '${ message } '`;
41- }
42- export function sameAs ( left : Compiler , right : Compiler ) : boolean {
43- const sameRange = ( left : Range , right : Range ) =>
44- left . start . line === right . start . line &&
45- left . start . character === right . start . character &&
46- left . end . line === right . end . line &&
47- left . end . character === right . end . character ;
48- const sameLocation = ( left : Location , right : Location ) =>
49- left . uri === right . uri && sameRange ( left . range , right . range ) ;
50- return (
51- left . message === right . message &&
52- left . details === right . details &&
53- sameLocation ( left . location , right . location )
54- ) ;
55- }
5627 }
5728 export const Codes = {
5829 Verify : 4001 ,
0 commit comments