author | rfield |
Wed, 08 Feb 2017 10:43:16 -0800 | |
changeset 43758 | 868af3718a21 |
parent 41865 | 3ef02797070d |
child 43770 | a321bed02000 |
permissions | -rw-r--r-- |
33362 | 1 |
/* |
2 |
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package jdk.jshell; |
|
27 |
||
39370
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
28 |
import java.util.Collection; |
33362 | 29 |
import java.util.List; |
30 |
||
31 |
/** |
|
32 |
* Provides analysis utilities for source code input. |
|
33 |
* Optional functionality that provides for a richer interactive experience. |
|
34 |
* Includes completion analysis: |
|
35 |
* Is the input a complete snippet of code? |
|
36 |
* Do I need to prompt for more input? |
|
37 |
* Would adding a semicolon make it complete? |
|
38 |
* Is there more than one snippet? |
|
39 |
* etc. |
|
40 |
* Also includes completion suggestions, as might be used in tab-completion. |
|
41 |
* |
|
42 |
*/ |
|
43 |
public abstract class SourceCodeAnalysis { |
|
44 |
||
45 |
/** |
|
46 |
* Given an input string, find the first snippet of code (one statement, |
|
47 |
* definition, import, or expression) and evaluate if it is complete. |
|
48 |
* @param input the input source string |
|
49 |
* @return a CompletionInfo instance with location and completeness info |
|
50 |
*/ |
|
51 |
public abstract CompletionInfo analyzeCompletion(String input); |
|
52 |
||
53 |
/** |
|
54 |
* Compute possible follow-ups for the given input. |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
55 |
* Uses information from the current {@code JShell} state, including |
33362 | 56 |
* type information, to filter the suggestions. |
57 |
* @param input the user input, so far |
|
58 |
* @param cursor the current position of the cursors in the given {@code input} text |
|
59 |
* @param anchor outgoing parameter - when an option will be completed, the text between |
|
60 |
* the anchor and cursor will be deleted and replaced with the given option |
|
61 |
* @return list of candidate continuations of the given input. |
|
62 |
*/ |
|
63 |
public abstract List<Suggestion> completionSuggestions(String input, int cursor, int[] anchor); |
|
64 |
||
65 |
/** |
|
41865 | 66 |
* Compute documentation for the given user's input. Multiple {@code Documentation} objects may |
67 |
* be returned when multiple elements match the user's input (like for overloaded methods). |
|
33362 | 68 |
* @param input the snippet the user wrote so far |
69 |
* @param cursor the current position of the cursors in the given {@code input} text |
|
41865 | 70 |
* @param computeJavadoc true if the javadoc for the given input should be computed in |
71 |
* addition to the signature |
|
72 |
* @return the documentations for the given user's input, if multiple elements match the input, |
|
73 |
* multiple {@code Documentation} objects are returned. |
|
33362 | 74 |
*/ |
41865 | 75 |
public abstract List<Documentation> documentation(String input, int cursor, boolean computeJavadoc); |
33362 | 76 |
|
77 |
/** |
|
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
78 |
* Infer the type of the given expression. The expression spans from the beginning of {@code code} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
79 |
* to the given {@code cursor} position. Returns null if the type of the expression cannot |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
80 |
* be inferred. |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
81 |
* |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
82 |
* @param code the expression for which the type should be inferred |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
83 |
* @param cursor current cursor position in the given code |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
84 |
* @return the inferred type, or null if it cannot be inferred |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
85 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
86 |
public abstract String analyzeType(String code, int cursor); |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
87 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
88 |
/** |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
89 |
* List qualified names known for the simple name in the given code immediately |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
90 |
* to the left of the given cursor position. The qualified names are gathered by inspecting the |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
91 |
* classpath used by eval (see {@link JShell#addToClasspath(java.lang.String)}). |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
92 |
* |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
93 |
* @param code the expression for which the candidate qualified names should be computed |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
94 |
* @param cursor current cursor position in the given code |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
95 |
* @return the known qualified names |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
96 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
97 |
public abstract QualifiedNames listQualifiedNames(String code, int cursor); |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
98 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
99 |
/** |
39370
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
100 |
* Returns the wrapper information for the {@code Snippet}. The wrapper changes as |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
101 |
* the environment changes, so calls to this method at different times may |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
102 |
* yield different results. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
103 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
104 |
* @param snippet the {@code Snippet} from which to retrieve the wrapper |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
105 |
* @return information on the wrapper |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
106 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
107 |
public abstract SnippetWrapper wrapper(Snippet snippet); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
108 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
109 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
110 |
* Returns the wrapper information for the snippet within the |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
111 |
* input source string. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
112 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
113 |
* Wrapper information for malformed and incomplete |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
114 |
* snippets also generate wrappers. The list is in snippet encounter |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
115 |
* order. The wrapper changes as the environment changes, so calls to this |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
116 |
* method at different times may yield different results. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
117 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
118 |
* The input should be |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
119 |
* exactly one complete snippet of source code, that is, one expression, |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
120 |
* statement, variable declaration, method declaration, class declaration, |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
121 |
* or import. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
122 |
* To break arbitrary input into individual complete snippets, use |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
123 |
* {@link SourceCodeAnalysis#analyzeCompletion(String)}. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
124 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
125 |
* The wrapper may not match that returned by |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
126 |
* {@link SourceCodeAnalysis#wrapper(Snippet) wrapper(Snippet)}, |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
127 |
* were the source converted to a {@code Snippet}. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
128 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
129 |
* @param input the source input from which to generate wrappers |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
130 |
* @return a list of wrapper information |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
131 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
132 |
public abstract List<SnippetWrapper> wrappers(String input); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
133 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
134 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
135 |
* Returns a collection of {@code Snippet}s which might need updating if the |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
136 |
* given {@code Snippet} is updated. The returned collection is designed to |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
137 |
* be inclusive and may include many false positives. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
138 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
139 |
* @param snippet the {@code Snippet} whose dependents are requested |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
140 |
* @return the collection of dependents |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
141 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
142 |
public abstract Collection<Snippet> dependents(Snippet snippet); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
143 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
144 |
/** |
33362 | 145 |
* Internal only constructor |
146 |
*/ |
|
147 |
SourceCodeAnalysis() {} |
|
148 |
||
149 |
/** |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
150 |
* The result of {@code analyzeCompletion(String input)}. |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
151 |
* Describes the completeness of the first snippet in the given input. |
33362 | 152 |
*/ |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
153 |
public interface CompletionInfo { |
33362 | 154 |
|
155 |
/** |
|
156 |
* The analyzed completeness of the input. |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
157 |
* |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
158 |
* @return an enum describing the completeness of the input string. |
33362 | 159 |
*/ |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
160 |
Completeness completeness(); |
33362 | 161 |
|
162 |
/** |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
163 |
* Input remaining after the complete part of the source. |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
164 |
* |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
165 |
* @return the portion of the input string that remains after the |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
166 |
* complete Snippet |
33362 | 167 |
*/ |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
168 |
String remaining(); |
33362 | 169 |
|
170 |
/** |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
171 |
* Source code for the first Snippet of code input. For example, first |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
172 |
* statement, or first method declaration. Trailing semicolons will be |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
173 |
* added, as needed. |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
174 |
* |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
175 |
* @return the source of the first encountered Snippet |
33362 | 176 |
*/ |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
177 |
String source(); |
33362 | 178 |
} |
179 |
||
180 |
/** |
|
181 |
* Describes the completeness of the given input. |
|
182 |
*/ |
|
183 |
public enum Completeness { |
|
184 |
/** |
|
185 |
* The input is a complete source snippet (declaration or statement) as is. |
|
186 |
*/ |
|
187 |
COMPLETE(true), |
|
188 |
||
189 |
/** |
|
190 |
* With this addition of a semicolon the input is a complete source snippet. |
|
191 |
* This will only be returned when the end of input is encountered. |
|
192 |
*/ |
|
193 |
COMPLETE_WITH_SEMI(true), |
|
194 |
||
195 |
/** |
|
196 |
* There must be further source beyond the given input in order for it |
|
197 |
* to be complete. A semicolon would not complete it. |
|
198 |
* This will only be returned when the end of input is encountered. |
|
199 |
*/ |
|
200 |
DEFINITELY_INCOMPLETE(false), |
|
201 |
||
202 |
/** |
|
203 |
* A statement with a trailing (non-terminated) empty statement. |
|
204 |
* Though technically it would be a complete statement |
|
205 |
* with the addition of a semicolon, it is rare |
|
206 |
* that that assumption is the desired behavior. |
|
207 |
* The input is considered incomplete. Comments and white-space are |
|
208 |
* still considered empty. |
|
209 |
*/ |
|
210 |
CONSIDERED_INCOMPLETE(false), |
|
211 |
||
212 |
||
213 |
/** |
|
214 |
* An empty input. |
|
215 |
* The input is considered incomplete. Comments and white-space are |
|
216 |
* still considered empty. |
|
217 |
*/ |
|
218 |
EMPTY(false), |
|
219 |
||
220 |
/** |
|
221 |
* The completeness of the input could not be determined because it |
|
222 |
* contains errors. Error detection is not a goal of completeness |
|
223 |
* analysis, however errors interfered with determining its completeness. |
|
224 |
* The input is considered complete because evaluating is the best |
|
225 |
* mechanism to get error information. |
|
226 |
*/ |
|
227 |
UNKNOWN(true); |
|
228 |
||
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
229 |
private final boolean isComplete; |
33362 | 230 |
|
231 |
Completeness(boolean isComplete) { |
|
232 |
this.isComplete = isComplete; |
|
233 |
} |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
234 |
|
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
235 |
/** |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
236 |
* Indicates whether the first snippet of source is complete. |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
237 |
* For example, "{@code x=}" is not |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
238 |
* complete, but "{@code x=2}" is complete, even though a subsequent line could |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
239 |
* make it "{@code x=2+2}". Already erroneous code is marked complete. |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
240 |
* |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
241 |
* @return {@code true} if the input is or begins a complete Snippet; |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
242 |
* otherwise {@code false} |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
243 |
*/ |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
244 |
public boolean isComplete() { |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
245 |
return isComplete; |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
246 |
} |
33362 | 247 |
} |
248 |
||
249 |
/** |
|
250 |
* A candidate for continuation of the given user's input. |
|
251 |
*/ |
|
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
252 |
public interface Suggestion { |
33362 | 253 |
|
254 |
/** |
|
255 |
* The candidate continuation of the given user's input. |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
256 |
* |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
257 |
* @return the continuation string |
33362 | 258 |
*/ |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
259 |
String continuation(); |
33362 | 260 |
|
261 |
/** |
|
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
262 |
* Indicates whether input continuation matches the target type and is thus |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
263 |
* more likely to be the desired continuation. A matching continuation is |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
264 |
* preferred. |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
265 |
* |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
266 |
* @return {@code true} if this suggested continuation matches the |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
267 |
* target type; otherwise {@code false} |
33362 | 268 |
*/ |
40498
f54048be4a57
8159027: JShell API: SourceCodeAnalysis.Suggestion has constructor, ...
rfield
parents:
39370
diff
changeset
|
269 |
boolean matchesType(); |
33362 | 270 |
} |
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
271 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
272 |
/** |
41865 | 273 |
* A documentation for a candidate for continuation of the given user's input. |
274 |
*/ |
|
275 |
public interface Documentation { |
|
276 |
||
277 |
/** |
|
278 |
* The signature of the given element. |
|
279 |
* |
|
280 |
* @return the signature |
|
281 |
*/ |
|
282 |
String signature(); |
|
283 |
||
284 |
/** |
|
285 |
* The javadoc of the given element. |
|
286 |
* |
|
287 |
* @return the javadoc, or null if not found or not requested |
|
288 |
*/ |
|
289 |
String javadoc(); |
|
290 |
} |
|
291 |
||
292 |
/** |
|
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
293 |
* List of possible qualified names. |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
294 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
295 |
public static final class QualifiedNames { |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
296 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
297 |
private final List<String> names; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
298 |
private final int simpleNameLength; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
299 |
private final boolean upToDate; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
300 |
private final boolean resolvable; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
301 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
302 |
QualifiedNames(List<String> names, int simpleNameLength, boolean upToDate, boolean resolvable) { |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
303 |
this.names = names; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
304 |
this.simpleNameLength = simpleNameLength; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
305 |
this.upToDate = upToDate; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
306 |
this.resolvable = resolvable; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
307 |
} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
308 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
309 |
/** |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
310 |
* Known qualified names for the given simple name in the original code. |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
311 |
* |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
312 |
* @return known qualified names |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
313 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
314 |
public List<String> getNames() { |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
315 |
return names; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
316 |
} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
317 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
318 |
/** |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
319 |
* The length of the simple name in the original code for which the |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
320 |
* qualified names where gathered. |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
321 |
* |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
322 |
* @return the length of the simple name; -1 if there is no name immediately left to the cursor for |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
323 |
* which the candidates could be computed |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
324 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
325 |
public int getSimpleNameLength() { |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
326 |
return simpleNameLength; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
327 |
} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
328 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
329 |
/** |
39370
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
330 |
* Indicates whether the result is based on up-to-date data. The |
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
331 |
* {@link SourceCodeAnalysis#listQualifiedNames(java.lang.String, int) listQualifiedNames} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
332 |
* method may return before the classpath is fully inspected, in which case this method will |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
333 |
* return {@code false}. If the result is based on a fully inspected classpath, this method |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
334 |
* will return {@code true}. |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
335 |
* |
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
336 |
* @return {@code true} if the result is based on up-to-date data; |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
337 |
* otherwise {@code false} |
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
338 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
339 |
public boolean isUpToDate() { |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
340 |
return upToDate; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
341 |
} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
342 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
343 |
/** |
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
344 |
* Indicates whether the given simple name in the original code refers |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
345 |
* to a resolvable element. |
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
346 |
* |
38908
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
347 |
* @return {@code true} if the given simple name in the original code |
f0c186d76c8a
8139829: JShell API: No use of fields to return information from public types
rfield
parents:
36160
diff
changeset
|
348 |
* refers to a resolvable element; otherwise {@code false} |
36160
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
349 |
*/ |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
350 |
public boolean isResolvable() { |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
351 |
return resolvable; |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
352 |
} |
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
353 |
|
f42d362d0d17
8131027: JShell API/tool: suggest imports for a class
jlahoda
parents:
33362
diff
changeset
|
354 |
} |
39370
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
355 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
356 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
357 |
* The wrapping of a snippet of Java source into valid top-level Java |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
358 |
* source. The wrapping will always either be an import or include a |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
359 |
* synthetic class at the top-level. If a synthetic class is generated, it |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
360 |
* will be proceeded by the package and import declarations, and may contain |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
361 |
* synthetic class members. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
362 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
363 |
* This interface, in addition to the mapped form, provides the context and |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
364 |
* position mapping information. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
365 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
366 |
public interface SnippetWrapper { |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
367 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
368 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
369 |
* Returns the input that is wrapped. For |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
370 |
* {@link SourceCodeAnalysis#wrappers(java.lang.String) wrappers(String)}, |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
371 |
* this is the source of the snippet within the input. A variable |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
372 |
* declaration of {@code N} variables will map to {@code N} wrappers |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
373 |
* with the source separated. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
374 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
375 |
* For {@link SourceCodeAnalysis#wrapper(Snippet) wrapper(Snippet)}, |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
376 |
* this is {@link Snippet#source() }. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
377 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
378 |
* @return the input source corresponding to the wrapper. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
379 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
380 |
String source(); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
381 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
382 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
383 |
* Returns a Java class definition that wraps the |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
384 |
* {@link SnippetWrapper#source()} or, if an import, the import source. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
385 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
386 |
* If the input is not a valid Snippet, this will not be a valid |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
387 |
* class/import definition. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
388 |
* <p> |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
389 |
* The source may be divided and mapped to different locations within |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
390 |
* the wrapped source. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
391 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
392 |
* @return the source wrapped into top-level Java code |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
393 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
394 |
String wrapped(); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
395 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
396 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
397 |
* Returns the fully qualified class name of the |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
398 |
* {@link SnippetWrapper#wrapped() } class. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
399 |
* For erroneous input, a best guess is returned. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
400 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
401 |
* @return the name of the synthetic wrapped class; if an import, the |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
402 |
* name is not defined |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
403 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
404 |
String fullClassName(); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
405 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
406 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
407 |
* Returns the {@link Snippet.Kind} of the |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
408 |
* {@link SnippetWrapper#source()}. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
409 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
410 |
* @return an enum representing the general kind of snippet. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
411 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
412 |
Snippet.Kind kind(); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
413 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
414 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
415 |
* Maps character position within the source to character position |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
416 |
* within the wrapped. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
417 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
418 |
* @param pos the position in {@link SnippetWrapper#source()} |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
419 |
* @return the corresponding position in |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
420 |
* {@link SnippetWrapper#wrapped() } |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
421 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
422 |
int sourceToWrappedPosition(int pos); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
423 |
|
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
424 |
/** |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
425 |
* Maps character position within the wrapped to character position |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
426 |
* within the source. |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
427 |
* |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
428 |
* @param pos the position in {@link SnippetWrapper#wrapped()} |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
429 |
* @return the corresponding position in |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
430 |
* {@link SnippetWrapper#source() } |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
431 |
*/ |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
432 |
int wrappedToSourcePosition(int pos); |
437ba9bd2582
8159111: JShell API: Add access to wrappers and dependencies
rfield
parents:
38908
diff
changeset
|
433 |
} |
33362 | 434 |
} |