Strange behaviour of code minings at line ends - eclipse-plugin

I have started implementing code minings in our plugin. As we try to support older versions of eclipse as well, the initial development platform was 4.19. As this release only provides LineHeaderCodeMining and LineContentCodeMining, I have created my own LineEndCodeMining that places the mining at the end of a given line. It is done by calculating the offset of the last character in the line and placing a LineContentCodeMining there. The feature based on this is quite similar to Gitlens; I display git commit info at the end of the current editor line.
Our text editor code overrides handleCursorPositionChanged() and that method is responsible for adding/removing these line end minings if the cursor moves to another line. At the end of the handler
((ISourceViewerExtension5)getSourceViewer()).updateCodeMinings();
is called to update the minings.
This works well in eclipse 4.19, however updating the minings works weird on recent eclipse versions: many times these line end minings are displayed only if I move the cursor again (even if I move the cursor horizontally, and this case the code mining related code paths like updateCodeMinings() are not called at all).
Just for testing, I have modified my code to place the minings at the character before the last one and that works perfectly. It seems the problem only occurs with content minings placed at the last character of a line.
I have the feeling it is somehow related to introducing LineEndCodeMining in Eclipse 4.23, but it is just a guess.
I would be happy for any pointers.
Extra question: as a workaround I was thinking of using LineEndCodeMining if it is available (eclipse >= 4.23) and use my own code for older versions. I am wondering what is the correct way to check for the availability of LineEndCodeMining; I cannot find any eclipse style IxxxxxExtension interface for this; should I check the Eclipse version itself?

Related

How can I force intellij to check all files?

When I'm using intellij sometimes I do very large refactors that the IDE can't help with. This often breaks a lot of files, but since I'm using either Typescript or Java it's relatively easy to find the problems.
My issue is that I can't seem to get Intellij to check those files unless I open them specifically.
The kind of checking I'm talking about isn't a specific inspection, it's just like the normal compilation problems.
So for example, I have a typescript project and I modified some stuff. When I open some of my React components intellij waits a second, and then highlights parts of it in red. I can go to those parts and see what the issue is.
I've tried forcing the inspector to run, and I've tried building the project, but neither one gives me the red squiggly love I need :^(
It feels like the project->build should force intellij to highlight all this stuff, but it seems to have no effect.

Having difficulty getting ZeroBrane to highlight code, autocomplete, etc

https://i.imgur.com/SlQ41BS.jpg
Here is an example. For some reason code is simply not being highlighted using the Lua 5.2 interpreter. Autocomplete doesn't appear to be working correctly either. Also whenever I declare a function it doesn't automatically add a space in the middle and the end at the bottom which I've seen. These would all be immensely helpful starting off. I have never coded before.
I don't see any issue with the highlighting, as the Lua code in your snapshot is highlighted. I'm not sure why auto-complete is not working in your case, but if you type "pr" and don't see "print" and "pairs" offered when Lua 5.2 interpreter is selected, you may want to open a ticket and we'll investigate.

Make MonoDevelop respect smcs.rsp

It's possible to create global defines, by placing them in smcs.rsp, and when you hit play - you'll notice those parts of the code are hit and everything is acting as if it should.
However when editing the source in MonoDevelop, it does not recognize the constants that are set in that file.
Leaving you with text that looks like this:
This makes it hard to keep track of what the current constant values are and requires mentally tracking what is turned on and off despite the editor constantly telling you otherwise.
Is it possible to get monodevelop to respect that file?
The method of using smcs.rsp is pretty old and is not needed after unity3d 4.x. Before 4.0 there is not way of doing it without smcs.rsp file but things have changed, the constants can be added from game itslef.
Go to Edit->Project Settings->Player and in the inspector, choose other settings and u will see configuration title, in the box below specify your symbols one by one followed by ;

Xcode code folding issue

After updating Xcode(5.0.1),one of my project files is automatically unfolding the code every time i leave the file or close Xcode.And this weird behavior is bothering me a lot,i already tried to delete and recreate it but didn't worked.
Anyone knows what might be causing this single file to have its code unfolded?
With Xcode-9, this issue is resolved. Code folding is being remembered and saved by Xcode 9 Editor.
Code you have/had folded exact before last source build/save, is automatically stored upon document/file closure. And same will be visible as it was (folded) when you will open document/file next time.
You don't need to do anything (there is no any option in Xcode tool bar to enable or disable) to save your code fold.
There's no way around it. xCode will unfold your code automatically. Period. There is no option to "preserve" code folding. (sad, but true...)

How to see live list of syntax errors in WebStorm 7 (or IntelliJ)?

While editing a JavaScript file, the IDE shows highlights on the lines that have problems and displays the lightbulb when you're on one of those lines.
How can I see a live list of all problems found in the current file (e.g. syntax errors)?
The only way I found so far was to manually run inspection and check the inspection window. That's quite cumbersome. Even the "Problems" section of the Project window updates itself automatically as soon as I change the code (even without saving) - but it doesn't display the actual errors (only which files have errors).
Apparently the IDE knows what errors exist in the file - I just can't find a way to see all of them in a list.
In every other IDE I know, it is a built-in, enabled-by-default, feature: eclipse, visual studio, brackets, etc.
Apparently this is an open issue on the IntelliJ family of products. Please upvote that issue if you feel it is missing as well!