<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests?Howyoufindoutthatyour projectwassuccessful? </hint> </question>
-->
<answer id="arch-quality">
<p>
LSP server is partially tested by unit tests. Some parts of the protocol are tested by integration tests,
so the full cycle client - server - client is covered.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> <hint> Contentofthisanswerwillbedisplayedaspartofpageat http://www.netbeans.org/download/dev/javadoc/usecases.html Youcanusetags<usecasename="name>regularhtmldescription</usecase> andifyouwanttouseanURLyoucanprefixifwith@TOP@tobegin attherootofyourjavadoc </hint> Describethemain<ahref="http://wiki.netbeans.org/API_Design#The_Importance_of_Being_Use_Case_Oriented"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
<p>
LSP clients can connect to the Language Server to get
</p>
<ul>
<li>code completion</li>
<li>diagnostics</li>
<li>node visual representations</li>
<li>code / fix actions</li>
<li>run / debug / test capability</li>
</ul>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
Generic server for use with LSP protocol, that exports functionality of
NetBeans plugins over the LSP protocol.
</p>
</answer>
<!-- <questionid="compat-i18n"when="impl"> Isyourmodulecorrectlyinternationalized? <hint> Correctinternationalizationmeansthatitobeysinstructions at<ahref="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html"> NetBeansI18Npages</a>. </hint> </question>
-->
<answer id="compat-i18n">
<p>
Most of LSP server itself is not I18ned.
</p>
</answer>
<!-- <questionid="exec-reflection"when="impl"> DoesyourcodeuseJavaReflectiontoexecuteothercode? <hint> ThisusuallyindicatesamissingorinsufficientAPIintheother partofthesystem.Iftheothersideisnotawareofyourdependency thiscontractcanbeeasilybroken. </hint> </question>
-->
<answer id="exec-reflection">
<ul>
<li>
<b>java.lang.ProcessHandle.allProcesses</b> from JDK is accessed by DAP implementation.</li>
<li>
<b>org.netbeans.modules.progress.spi.InternalHandle.controller</b> field is accessed to prevent assertions when controller is initialized twice.</li>
<li>
<b>org.netbeans.modules.groovy.editor.api.GroovyIndexer.setIndexingEnabled</b> is called reflectively. This is a temporary workaround and will be removed.</li>
<li>
<b>org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation.reset</b> is called reflectively to reset file - project ownership cache.
</li>
</ul>
</answer>
<!-- <questionid="exec-threading"when="init"> Whatthreadingmodels,ifany,doesyourmoduleadhereto?Howthe projectbehaveswithrespecttothreading? <hint> IsyourAPIthreadsafe?Canitbeaccessedfromanythreadsor justfromsomededicatedones?AnyspecialrelationtoAWTand itsEventDispatchthread?Also ifyourmodulecallsforeignAPIswhichhaveaspecificthreadingmodel, indicatehowyoucomplywiththerequirementsformultithreadedaccess (synchronization,mutexes,etc.)applicabletothoseAPIs. IfyourmoduledefinesanyAPIs,orhascomplexinternalstructures thatmightbeusedfrommultiplethreads,declarehowyouprotect dataagainstconcurrentaccess,raceconditions,deadlocks,etc., andwhethersuchrulesareenforcedbyruntimewarnings,errors,assertions,etc. Examples:aclassmightbenon-thread-safe(likeJavaCollections);might befullythread-safe(internallocking);mightrequireaccessthroughamutex (andmayormaynotautomaticallyacquirethatmutexonbehalfofaclientmethod); mightbeabletorunonlyintheeventqueue;etc. Alsodescribewhenanyeventsarefired:synchronously,asynchronously,etc. Ideas:<ahref="http://core.netbeans.org/proposals/threading/index.html#recommendations">ThreadingRecommendations</a>(inprogress) </hint> </question>
-->
<answer id="exec-threading">
<p>
The LSP server executes on a single thread that receives messages. The LSP protocol works with CompletableFutures to indicate eventual completion of
the task. Any longer work must be forked off to a separate thread, so the main reception thread is not blocked. In a sense the reception thread acts like
the event dispatch thread in desktop platform app.
</p>
<p>
The main entry point establishes a connection-specifc <b>defautl Lookup</b> that is propagated to individual RequestProcessor tasks so that the asynchronously
executed code can connect with the originating client.
</p>
</answer>
<!-- <questionid="resources-read"when="final"> Doesyourmodulereadanyresourcesfromlayers?Forwhatpurpose? <hint> Asthisissomekindofintermoduledependency,itisakindofAPI. Pleasedescribeitandclassifyaccordingto <ahref="http://wiki.netbeans.org/API_Design#What_is_an_API.3F"> commonstabilitycategories</a>. </hint> </question>
-->
<answer id="resources-read">
<api group="layer" name="Explorers"type="export" category="private">
<p>
To create an <b>Explorer View</b> for LSP protocol an <a href="@TOP@/org/netbeans/modules/lsp/server/explorer/api/ExplorerManagerFactory.html">ExplorerManagerFactory</a> must
be provided in a folder <b>Explorers/<view-id</b>.
</p>
</api>
<api group="property" name="TreeItemTags"type="export" category="private">
<p>
Items in each Explorer View can be tagged with <b>Context Values</b> as defined by LSP protocol. Since it is not possible to enumerate all interfaces in a Node's Lookup, each
view can declare the services of interest that should be converted to tags. By default, each Node is tagged with these values:
</p>
<table>
<tbody>
<tr><td>is:folder</td><td>the Node represents a folder, or a DataFolder</td><td></td></tr>
<tr><td>is:file</td><td>the Node represents a file</td><td></td></tr>
<tr><td>is:project</td><td>the Node represents a project (the project's node itself)</td><td></td></tr>
<tr><td>is:projectRoot</td><td>the Node represents a root project in a multi-project tree</td><td></td></tr>
<tr><td>is:subProject</td><td>the Node represents a subproject in a multi-project tree</td><td></td></tr>
<tr><td>cap:rename</td><td>the Node can be renamed (Rename action is available)</td><td></td></tr>
<tr><td>cap:delete</td><td>the Node can be deleted (Delete action is available)</td><td></td></tr>
</tbody>
</table>
<p>
Services whose presence should be noted as a tag for TreeItem should be enumerated in files with "<b>.contextValues</b>" extension in the view's folder. The file should be a plaintext file,
each line defines a service FQN interface that should be converted to a tag, and a possible tag value for it. If no other instruction is given the service's FQN will be used as in a tag value
in a form "<b>class:<i><service-fqn></i></b>. The <b>class:</b> prefix is always prepended to provide a different namespace from e.g. <i>cap:xxx</i> values. By default, prefixes <b>org.openide.api.actions.</b>
and <b>org.openide.cookies.</b> are stripped to make most common "cookies" nicer to read.
</p>
<p>
Blank lines or lines that start with a hash sign (#) are ignore. Other lines are interpreted as follows:
</p>
<table>
<thead>
<tr>
<th>Syntax</th>
<th>Explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td>org.netbeans.api.actions.Openable</td>
<td>Service FQN to search in Lookup. Its FQN will be used in the class: tag value - subject to prefix stripping</td>
</tr>
<tr>
<td>[org.netbeans.api.]project.Project</td>
<td>If <b>org.netbeans.api.project.Project</b> service is present in node's Lookup, the prefix in brackets will be stripped, so the node will be tagged with <b>project.Project</b></td>
</tr>
<tr>
<td>[org.netbeans.lib.=lib.]</td>
<td>No text follows the closing brace. The prefix <b>org.netbeans.lib</b> in all service FQNs will be replaced with the text after equal sign. If the closing brace immediately follows the
equal sign, the prefix will be stripped.
</td>
</tr>
</tbody>
</table>
</api>
<api group="layer" name="TemplateAttributes"type="export" category="private">
<p>
When creating a file from template, the template may suggest a place in <b>project content</b> where the file should be generated. LSP server uses the suggestion as a hint if the user e.g.
works with the project root to select an appropriate folder. The hint attributes should be placed on the <b>template file in XML layer</b> or on <b>one of its parent folder</b>. Folder attribute
applies to all folder's subtree unless redefiend on a specific contained file or folder.
</p>
<table>
<thead>
<tr>
<th>File attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>new.sourceGroup</td>
<td>Source Group suitable for the template contents. See for example <a href="@org-netbeans-api-project-JavaProjectConstants@/org//netbeans/api/java/project/JavaProjectConstants.html#SOURCES_TYPE_JAVA">
JavaProjectConstants.SOURCES_TYPE_JAVA</a>.
</td>
</tr>
<tr>
<td>new.sourceHint</td>
<td>A <code>SourceGroupModifier</code> type for the desired source. See for example <a href="@org-netbeans-api-project-JavaProjectConstants@/org//netbeans/api/java/project/JavaProjectConstants.html#SOURCES_HINT_TEST">
JavaProjectConstants.SOURCES_HINT_TEST</a>.
</td>
</tr>
</tbody>
</table>
</api>
</answer>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.