I'm wondering if there's a better way to get syntax highlighting for OpenCL in Eclipse 4.2.1 CDT. The only way I could figure out was something I did by accident, which seems to work so far, but I hope there's a better way because this way seems almost like a bug or something:
Go to: Window -> Preferences -> General -> Content Types
-> Text -> C Source File -> C++ Source File
Under file associations, click Add, and in the popup window, type:
*.cl
Click OK, then click OK
Open any .cl file from the Project Explorer to see that it's almost
good. There is now some syntax highlighting, but there are syntax
errors showing for perfectly valid OpenCL code...
Go back to the same area of the Preferences menu where you were
before, remove the *.cl rule that you previously added.
Click OK, then click OK
Close the .cl file and open it again, now it should mostly be good!
Of course, this method only highlights code that's valid C++ (not even all of it), and ignores OpenCL-specific stuff, but it's the closest thing to proper syntax highlighting I can figure out how to get in Eclipse.
This appears to "work" because it allows the .cl file to be opened with Eclipse's C/C++ Editor (enabling some syntax highlighting), and also excludes the file from both the static analyzer (removes some syntax errors) and the automatically generated project Makefile (prevents Eclipse from trying to build the .cl file as if it were C++ source).
Related
Use IntelliJ IDEA for macOS. Problem
Whenever I do ⌥+⌘+L (shortcut to reformat code in macOS), code clean up does not apply.
I noticed that because I turned on the Final Modifier already (Make generated local variables final and Make generated parameters final in Settings: Editor -> Code Style -> Java -> Code Generation). But after shortcut, no finals are added.
However, if I do ⌥+⇧+⌘+L to open the reformat dialog and click run, it does add final to variables and parameters). It also work when I right click the file and choose reformat code.
I don't know why, isn't ⌥+⌘+L a shortcut that should do exactly the same thing?
This bring out my other question, is ⌥+⇧+⌘ really applying all my customize settings in Code Style and Inspections (assume I selected the right scheme (under Code Style) and profile (under inspections)?
My last question is, for example, let's say I have a custom scheme in IDE level for Code Style. Every time when I clone a project from let's say GitHub, how do I make the project automatically using my custom scheme instead of using the Project scheme and the Default scheme? Every time I have to go to Code Style and manually switch from "Stored in Project" to "Stored in IDE", so that I can select my custom scheme and click apply. Is there an easy way? Same for Inspections profile, I have to manually switch.
I have tried to solve these for so long, any help will be appreciated! Below are some links I found, but didn't solve my questions
Reformat code
Reformat file dialog
Code Style
So I just got into TDD and working with tests I started using the Assistant editor a lot more. I usually keep my test file on the left and production code on the right. However, when running a test, if I hit an exception or a breakpoint in my production code, the file opens up on the right again, even though it is already open on the left.
My goal is to have Xcode focus on the exception/breakpoint in the Assistant editor if the relevant file is open right now. Is there any way to achieve such behaviour?
The closest thing I found was in the Behaviour tab in preferences where I can choose which editor jumps to the exception/breakpoint, but this should depend on which file did it occur in. So if there is a problem in currently open test file, show it on the left. If it is in currently open production file, show it on the right. If it is in a file that is not showing, then show it wherever.
Thanks
I'm using Visual Studio 2015 (14.0.x - update 3) and no matter what I try, I can't get All Languages to do Smart indenting. I go into Tools -> Options -> Text Editor -> All Languages -> Tabs and set it like so:
I've got a handler file open in VS (.ashx file) with inline code:
Notice that when I position my cursor right after the opening curly brace and hit Enter, the cursor goes to the next line, but indents too far over. This does not happen when a c# file is being edited. When I go back into Options to see what is going on, I am surprised to find Smart formatting cleared:
It doesn't matter how many times I re-select Smart, it doesn't honor it, and it clears it again. I don't believe ASHX file types have their own registered Text Editor type in VS, but maybe it does, listed under something unexpected, and that is overwriting it. I can't see any types that even resemble 'handler', or etc.
I even tried hand-editing the .vssettings file to enable Smart, but it still doesn't work, and Smart is cleared again when I go into Options.
I have read this post and tried to follow it, but my case is a little different.
How can I get the same indent behavior on my ASHX file as I get with .cs files, so that when hitting Enter after a line, it goes to the correct place on the next line, as expected?
Smart indenting is not applicable for all languages and hence the check is disappeared for All Languages, but the option is checked for C# ,html etc. for any applicable language.
Please refer to this link: https://learn.microsoft.com/en-us/visualstudio/ide/reference/options-text-editor-all-languages-tabs?view=vs-2015
I recently downloaded CLion to use with C++ and it's working fine, I just wanted to know if/how I could view std::cout. If not in the CLion output console, then maybe in a separate terminal window using the CMakeLists.txt file? Again, my code is building fine, I just want to know how/if I can view the output (similar to what I'd be able to do in Eclipse, XCode, or even Sublime).
You'll see it in the "run" tab, not the "terminal" tab
From the dropdown box at the top, make sure you have the correct target selected and hit the play button.
I'm trying to get MonoDevelop-Unity to behave more like Visual Studio. I have compiled a list of issues regarding this.
1) Errors are never automatically shown on the Error Pane at the bottom of the main window. I have to tab to Unity to see them.
2) The document is never automatically formatted in real-time when typing. I would like the line to be properly spaced when appending it with a ';', the same goes for '}'.
I have played around with Tools -> Options -> Text Editor -> Indentation and Source Code settings but to no avail.
3) When hitting run I have to go into Unity and hit run rather than Unity being run automatically
Can anyone please tell me how these issues can be resolved?