This repository has been archived by the owner on Feb 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathproblems.js
40 lines (35 loc) · 1.61 KB
/
problems.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*******************************************************************************
* @license
* Copyright (c) 2010, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
* License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
*
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*eslint-env browser, amd*/
define(["orion/EventTarget"], function(EventTarget) {
/**
* Creates a new problem service instance. Client should obtain the service
* <tt>orion.core.marker</tt> from the service registry rather than instantiate
* this service directly.
* @class The problem service tracks markers and sends notification of marker changes.
* @name orion.problems.ProblemService
*/
function ProblemService(serviceRegistry, serviceID) {
this._serviceRegistry = serviceRegistry;
EventTarget.attach(this);
this._serviceRegistration = serviceRegistry.registerService(serviceID || "orion.core.marker", this); //$NON-NLS-0$
}
ProblemService.prototype = /** @lends orion.problems.ProblemService.prototype */ {
// provider
_setProblems: function(problems, uri) {
this.problems = problems;
this.dispatchEvent({type:"problemsChanged", uri: uri, problems:problems}); //$NON-NLS-0$
}
};
ProblemService.prototype.constructor = ProblemService;
//return the module exports
return {ProblemService: ProblemService};
});