mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-10 12:56:32 +00:00
fix: do not exclude cloud sketch diagnostics
PROEDITOR-50: error markers have been disabled for built-ins (daedae1). Relaxed the error marker filtering for cloud sketches. Closes #669 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
parent
51f69f6a59
commit
e6828f86d7
@ -8,6 +8,10 @@ import { AuthenticationSession } from '../../node/auth/types';
|
|||||||
import { ArduinoPreferences } from '../arduino-preferences';
|
import { ArduinoPreferences } from '../arduino-preferences';
|
||||||
import { AuthenticationClientService } from '../auth/authentication-client-service';
|
import { AuthenticationClientService } from '../auth/authentication-client-service';
|
||||||
import { LocalCacheFsProvider } from '../local-cache/local-cache-fs-provider';
|
import { LocalCacheFsProvider } from '../local-cache/local-cache-fs-provider';
|
||||||
|
import {
|
||||||
|
ARDUINO_CLOUD_FOLDER,
|
||||||
|
REMOTE_SKETCHBOOK_FOLDER,
|
||||||
|
} from '../utils/constants';
|
||||||
import { CreateUri } from './create-uri';
|
import { CreateUri } from './create-uri';
|
||||||
|
|
||||||
export type CloudSketchState = 'push' | 'pull';
|
export type CloudSketchState = 'push' | 'pull';
|
||||||
@ -128,8 +132,8 @@ export class CreateFeatures implements FrontendApplicationContribution {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return dataDirUri
|
return dataDirUri
|
||||||
.resolve('RemoteSketchbook')
|
.resolve(REMOTE_SKETCHBOOK_FOLDER)
|
||||||
.resolve('ArduinoCloud')
|
.resolve(ARDUINO_CLOUD_FOLDER)
|
||||||
.isEqualOrParent(new URI(sketch.uri));
|
.isEqualOrParent(new URI(sketch.uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ import {
|
|||||||
import { AuthenticationClientService } from '../auth/authentication-client-service';
|
import { AuthenticationClientService } from '../auth/authentication-client-service';
|
||||||
import { AuthenticationSession } from '../../common/protocol/authentication-service';
|
import { AuthenticationSession } from '../../common/protocol/authentication-service';
|
||||||
import { ConfigService } from '../../common/protocol';
|
import { ConfigService } from '../../common/protocol';
|
||||||
|
import {
|
||||||
|
ARDUINO_CLOUD_FOLDER,
|
||||||
|
REMOTE_SKETCHBOOK_FOLDER,
|
||||||
|
} from '../utils/constants';
|
||||||
|
|
||||||
export namespace LocalCacheUri {
|
export namespace LocalCacheUri {
|
||||||
export const scheme = 'arduino-local-cache';
|
export const scheme = 'arduino-local-cache';
|
||||||
@ -107,7 +111,7 @@ export class LocalCacheFsProvider
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._localCacheRoot = localCacheUri;
|
this._localCacheRoot = localCacheUri;
|
||||||
for (const segment of ['RemoteSketchbook', 'ArduinoCloud']) {
|
for (const segment of [REMOTE_SKETCHBOOK_FOLDER, ARDUINO_CLOUD_FOLDER]) {
|
||||||
this._localCacheRoot = this._localCacheRoot.resolve(segment);
|
this._localCacheRoot = this._localCacheRoot.resolve(segment);
|
||||||
await fileService.createFolder(this._localCacheRoot);
|
await fileService.createFolder(this._localCacheRoot);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,10 @@ import { Marker } from '@theia/markers/lib/common/marker';
|
|||||||
import { ProblemManager as TheiaProblemManager } from '@theia/markers/lib/browser/problem/problem-manager';
|
import { ProblemManager as TheiaProblemManager } from '@theia/markers/lib/browser/problem/problem-manager';
|
||||||
import { ConfigServiceClient } from '../../config/config-service-client';
|
import { ConfigServiceClient } from '../../config/config-service-client';
|
||||||
import debounce = require('lodash.debounce');
|
import debounce = require('lodash.debounce');
|
||||||
|
import {
|
||||||
|
ARDUINO_CLOUD_FOLDER,
|
||||||
|
REMOTE_SKETCHBOOK_FOLDER,
|
||||||
|
} from '../../utils/constants';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class ProblemManager extends TheiaProblemManager {
|
export class ProblemManager extends TheiaProblemManager {
|
||||||
@ -16,12 +20,18 @@ export class ProblemManager extends TheiaProblemManager {
|
|||||||
private readonly configService: ConfigServiceClient;
|
private readonly configService: ConfigServiceClient;
|
||||||
|
|
||||||
private dataDirUri: URI | undefined;
|
private dataDirUri: URI | undefined;
|
||||||
|
private cloudCacheDirUri: URI | undefined;
|
||||||
|
|
||||||
@postConstruct()
|
@postConstruct()
|
||||||
protected override init(): void {
|
protected override init(): void {
|
||||||
super.init();
|
super.init();
|
||||||
this.dataDirUri = this.configService.tryGetDataDirUri();
|
this.dataDirUri = this.configService.tryGetDataDirUri();
|
||||||
this.configService.onDidChangeDataDirUri((uri) => (this.dataDirUri = uri));
|
this.configService.onDidChangeDataDirUri((uri) => {
|
||||||
|
this.dataDirUri = uri;
|
||||||
|
this.cloudCacheDirUri = this.dataDirUri
|
||||||
|
?.resolve(REMOTE_SKETCHBOOK_FOLDER)
|
||||||
|
.resolve(ARDUINO_CLOUD_FOLDER);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
override setMarkers(
|
override setMarkers(
|
||||||
@ -29,7 +39,13 @@ export class ProblemManager extends TheiaProblemManager {
|
|||||||
owner: string,
|
owner: string,
|
||||||
data: Diagnostic[]
|
data: Diagnostic[]
|
||||||
): Marker<Diagnostic>[] {
|
): Marker<Diagnostic>[] {
|
||||||
if (this.dataDirUri && this.dataDirUri.isEqualOrParent(uri)) {
|
if (
|
||||||
|
this.dataDirUri &&
|
||||||
|
this.dataDirUri.isEqualOrParent(uri) &&
|
||||||
|
this.cloudCacheDirUri && // Do not disable the diagnostics for cloud sketches https://github.com/arduino/arduino-ide/issues/669
|
||||||
|
!this.cloudCacheDirUri.isEqualOrParent(uri)
|
||||||
|
) {
|
||||||
|
// If in directories.data folder but not in the cloud sketchbook cache folder.
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return super.setMarkers(uri, owner, data);
|
return super.setMarkers(uri, owner, data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user