There is a way to use lsp4e for calling language server methods directly? - eclipse

I'm new to the lsp4e & lsp technologies and as far as I have seen the framework provides almost everything for working with eclipse. However there is a way to use this features at will? i.e I would like to use the LS to get all the functions on a file, I think this will be done with textDocument/documentSymbol but how can I get this using the lsp4e framework?
NOTE:
I checked for SymbolKind and seems it was not the one I was looking for however that input helped me finding a sample of DocumentSymbol
DocumentSymbolParams params = new DocumentSymbolParams(
new TextDocumentIdentifier(documentUri.toString()));
CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> symbols =
languageServer.getTextDocumentService().documentSymbol(params);

I checked for SymbolKind and seems it was not the one I was looking for. However that input helped me finding a sample of DocumentSymbol
DocumentSymbolParams params = new DocumentSymbolParams(
new TextDocumentIdentifier(documentUri.toString()));
CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> symbols =
languageServer.getTextDocumentService().documentSymbol(params);

Related

Make tile-ID request URL work with mapbox-style "satellite-streets" using folium

I use Python for plotting geospatial data on maps.
For certain map-styles, such as ["basic", "streets", "outdoors", "light", "dark", "satellite", "satellite-streets"], I need a mapbox-access token and for some geospatial plotting packages like folium I even need to create my own link for retrieving the map-tiles.
So far, it worked great with the style "satellite":
mapbox_style = "satellite"
mapbox_access_token = "....blabla"
request_link = f"https://api.mapbox.com/v4/mapbox.{mapbox_style}/{{z}}/{{x}}/{{y}}#2x.jpg90?access_token={mapbox_access_token}"
However, when choosing "satellite-streets" as mapbox-tile-ID, the output doesn't show a background map anymore. It fails with inserting "satellite-streets", "satellitestreets" and "satellite_streets" into the aforementioned link-string.
Why is that and how can I come to know what's the correct tile-ID-name for "satellite-streets"?
I found an answer when reaching out to the customer support.
Apparently, one has to access the static APIs which have specific names listed on their website:
"In general, the styles that you mentioned including
"satellite_streets" that you are referencing are our classic styles
that are going to be deprecated starting June 1st. I would recommend
using our modern static API the equivalent modern styles. This
will allow you to see the most updated street data as well.
Like the example request below:
https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/1/1/0?access_token={your_token}
Here is more info on the deprecation of the classic styles and
the migration guide for them."
My personal adaptation after having tried everything out myself, is:
Via combining the above-mentioned with the details on how to construct a Mapbox-request link on this documention from mapbox' website,
I finally managed to make it work.
An example request looks like so (in python using f-strings):
mapbox_tile_URL = f"https://api.mapbox.com/styles/v1/mapbox/{tileset_ID_str}/tiles/{tilesize_pixels}/{{z}}/{{x}}/{{y}}#2x?access_token={mapbox_access_token}"
The tileset_ID_str could be e.g. "satellite-streets-v11" which can be seen at the following link containing valid static maps.

Can not find get_Item() method for ListTemplates

I'm working on a C#/VSTO application for automate some tasks in MS Word. I'm trying to change the start number of a numbered list using a ListTemplate. I've seen several examples of accessing a ListTemplate like this:
ListTemplate template =
app.ListGalleries[WdListGalleryType.wdNumberGallery].ListTemplates.get_Item(ref n);
However, Visual Studio doesn't recognize get_Item() as a method for ListTemplates. Other methods of ListTemplates are listed in the VS popup so I'm not sure what the issue is? How do I go about referencing a ListTemplate? Thanks!
When I check in VSTO there is no get_Item for ListTemplates. Instead, one uses the index. For example
ListTemplate template =app.ListGalleries[Word.WdListGalleryType.wdNumberGallery].ListTemplates[Word.WdListGalleryType.wdNumberGallery];

Can't find Lucene.Net.Spatial.Tier namespace with the current version of Lucene.Net

In my search for a geolocation search implementation using lucene.net I encountered this article from leapinggorilla.com and download the source code but have no luck compiling, I added the reference using nugget but still no luck, and if I browse the assembly using object browser, can't find the Namespace either.
Any suggestions to what I am missing?
Thanks
The spatial module in Lucene 3.x was found to be buggy and unmaintained, so it's gone as of Lucene 4.x. Lucene 4.x has a new spatial module that I developed with 2 others. If you download it, you should look at the "SpatialExample.java" in the tests (perhaps there's a .net equivalent). You also might want to watch the presentation I gave at Lucene/Solr Revolution, or simply flip through the slides:
http://www.lucenerevolution.org/2013/Lucene-Solr4-Spatial-Deep-Dive
Lucene.Net is at version 3.0.3 and the 3.x spatial module was dropped from it as well. The 4.x spatial module was backported from java lucene 4.x. You can view the source here and the unit tests here
Unfortunately, that means that most of the older blog posts won't work directly with the new API. However, since most of the API calls should be that same as java's, so I would assume that any blog posts written for java could be translated to .NET.
I have a Lucene.NET 3.0.3 solution which allows spatial search with ordering (from a centre point), within a circle of a given radius.
The answer is here on StackOverflow, and a full VS solution can be found on GitHub.
The key portion of code which drives the spatial search is this:
var spatialArgs = new SpatialArgs(SpatialOperation.Intersects, searchArea);
var spatialQuery = _strategy.MakeQuery(spatialArgs);
var valueSource = _strategy.MakeRecipDistanceValueSource(searchArea);
var valueSourceFilter = new ValueSourceFilter(new QueryWrapperFilter(spatialQuery), valueSource, 0, 1);
var filteredSpatial = new FilteredQuery(query, valueSourceFilter); // Restricts results to searchArea
var spatialRankingQuery = new FunctionQuery(valueSource); // Orders results by distance (closest first)
var bq = new BooleanQuery();
bq.Add(filteredSpatial,Occur.MUST);
bq.Add(spatialRankingQuery,Occur.MUST);
Please let me know if anything is unclear. I urge anyone curious to download and examine the full solution.

cfscript Code Assist in CFBuilder

I'm increasingly using cfscript, and like it where appropriately used.
One problem is that there doesn't appear to be any code assist for cfscript in CF Builder, so I find myself writing the tag of a function to leverage the code Assist, then converting to cfscript (which is silly).
For example:
addParam() is the cfscript equivalent of <cfqueryparam >. I get code assist when writing the the tag version, but not the script equivalent.
Does anyone know if there is a code assist library available for cfscript in cfBuilder? Or is this just a downside of working with cfscript?
Many Thanks in advance!
Jason
Your example is not using native CFScript, it's using the hack-solution Adobe provided for some shortcomings of CFScript's coverage of CF tags, which are implemented as a bunch of CFCs in the custom tags dir of your install. This stuff is not representative of CFML & its CFScript support as a whole.
I find that CFB gives hinting for most native functionality... is this not the case for you? What if you try listAppend() for example? Do you get code-assist for that?
UPDATE
I wonder if you get a warning in CFB on your line equivalent to this:
o = new Query();
? I do, by default. I have to make a link to the CustomTags/com dir, and then use this syntax:
o = new com.adobe.Query();
Then I don't get a warning, and indeed I get the code assist you're expecting. I cannot get it to give me hinting on just the non-qualified path to Query.cfc though.
Not ideal. Or maybe I'm missing something, too.

Updating Jira Plugin from Version 3 to Version 4, Replacing SearchParameter

i am pretty new to Jira Development so please be patient
I should upgrade a Plugin that worked with Jira Version 3 to work with Jira Version 4
Most of the thins went pretty well, but now i am kind of stuck
The SearchParameter and the ProjectParameter Class are not available in the new Version and i dont exacly know how to replace them. its really just this few lines of code, where its needed
these Classes are outdated: SearchParameter and ProjectParameter
i looked in the jira doc buts its seems pretty complicated, you would do me a great favor if you could help me
SearchRequest sr = srs.getFilter(ctx, filterId);
...
SearchParameter param = sr.getParam(new ProjectParameter().getName());
...
List columns = columnLayout
.getVisibleColumnLayoutItems(user,
param.getValues(), Collections.EMPTY_LIST);
It would even Help if you could explain what the seccond Line intends
Thanks in advance
I can't help you rewrite the plugin entirely, but I can try help you decipher what those quoted lines of code mean:
SearchRequest sr = srs.getFilter(ctx, filterId);
This line loads a saved SearchRequest with the corresponding filterId.
SearchParameter param = sr.getParam(new ProjectParameter().getName());
This line gets the Project search parameter that was saved in the SearchRequest. As you may know, SearchRequests (or saved filters if you prefer) all you to save a search from JIRA with parameters defined. One possible parameter to define is a ProjectParameter. So if your search is "all issues in project X", then you would have a SearchParameter in your SearchRequest which is a ProjectParameter that knows to search for project X.
List columns = columnLayout
.getVisibleColumnLayoutItems(user,
param.getValues(), Collections.EMPTY_LIST);
This line retrieves the ColumnLayoutItems which are visible to the specified user, for the specified projects of the SearchRequest (by extracting the value from the ProjectParameter of the SearchRequest as retrieved in line 2).
It's a bit unclear what this code is attempting to do without more context, but that's what those lines are doing anyway. You might find the API documentation useful:
http://docs.atlassian.com/jira/3.13/
http://docs.atlassian.com/jira/3.13/com/atlassian/jira/issue/fields/layout/column/ColumnLayout.html