File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed
delphi-checks-testkit/src/main/java/au/com/integradev/delphi/checks/verifier
delphi-frontend/src/main/java
au/com/integradev/delphi/check
org/sonar/plugins/communitydelphi/api/check Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Added
11
+
12
+ - ** API:** ` DelphiCheckContext::getUri ` method.
13
+
10
14
### Fixed
11
15
12
16
- Parsing errors on semicolon-delimited generic type parameters in routine implementation headers.
Original file line number Diff line number Diff line change 22
22
import au .com .integradev .delphi .file .DelphiFile .DelphiInputFile ;
23
23
import au .com .integradev .delphi .preprocessor .CompilerSwitchRegistry ;
24
24
import au .com .integradev .delphi .reporting .DelphiIssueBuilderImpl ;
25
+ import java .net .URI ;
25
26
import java .util .ArrayList ;
26
27
import java .util .Collection ;
27
28
import java .util .List ;
@@ -58,6 +59,11 @@ public DelphiCheckContextTester(
58
59
this .checkRegistrar = checkRegistrar ;
59
60
}
60
61
62
+ @ Override
63
+ public URI getUri () {
64
+ return delphiFile .getInputFile ().uri ();
65
+ }
66
+
61
67
@ Override
62
68
public DelphiAst getAst () {
63
69
return delphiFile .getAst ();
Original file line number Diff line number Diff line change 21
21
import au .com .integradev .delphi .file .DelphiFile .DelphiInputFile ;
22
22
import au .com .integradev .delphi .preprocessor .CompilerSwitchRegistry ;
23
23
import au .com .integradev .delphi .reporting .DelphiIssueBuilderImpl ;
24
+ import java .net .URI ;
24
25
import java .util .List ;
25
26
import org .sonar .api .batch .sensor .SensorContext ;
26
27
import org .sonar .plugins .communitydelphi .api .ast .DelphiAst ;
@@ -51,6 +52,11 @@ public DelphiCheckContextImpl(
51
52
this .checkRegistrar = checkRegistrar ;
52
53
}
53
54
55
+ @ Override
56
+ public URI getUri () {
57
+ return delphiFile .getInputFile ().uri ();
58
+ }
59
+
54
60
@ Override
55
61
public DelphiAst getAst () {
56
62
return delphiFile .getAst ();
Original file line number Diff line number Diff line change 19
19
package org .sonar .plugins .communitydelphi .api .check ;
20
20
21
21
import au .com .integradev .delphi .preprocessor .CompilerSwitchRegistry ;
22
+ import java .net .URI ;
22
23
import java .util .List ;
23
24
import java .util .Objects ;
25
+ import org .sonar .api .batch .fs .InputFile ;
24
26
import org .sonar .plugins .communitydelphi .api .ast .DelphiAst ;
25
27
import org .sonar .plugins .communitydelphi .api .ast .DelphiNode ;
26
28
import org .sonar .plugins .communitydelphi .api .directive .CompilerDirectiveParser ;
30
32
31
33
/** Context injected in check classes and used to report issues. */
32
34
public interface DelphiCheckContext {
35
+ /**
36
+ * Identifier of the file. The only guarantee is that it is unique in the project. You should not
37
+ * assume it is a file:// URI.
38
+ *
39
+ * @return identifier of the file
40
+ * @see InputFile#uri()
41
+ */
42
+ URI getUri ();
43
+
33
44
/**
34
45
* Returns the parsed ast of the current file.
35
46
*
You can’t perform that action at this time.
0 commit comments