I have reinstalled the last version of IntelliJ IDEA and then when I try to format an SQL file, it orders all the lines as shown on the image.
However, I have not made any settings for SQL formatting in the previous versions and the format was OK as shown on my current setting preview as shown below:
So, is there anything default to format SQL properly? There are lots of choices in the settings, but I just want to use a default one available on the settings (I tried but it format almost the same).
Faced same issue. Settings/Languages&Frameworks/SQL Dialects, there you can find the dialect of file. Change it to what you use.
That's how I solved problem, even though you apply global or project SLQ Dialect, somehow the file may not be updated.
As you see from the image, Generic SQL causes problem here.
Related
VS Code is colorizing the script in my .sql files, but with what seem to be some errors. For example I would expect "RENAME" to be colorized here:
I've tried using a few extensions, but I can't fix this problem. I don't know if it's because I'm using postgreSQL and it's reading some other SQL dialect? Any assistance appreciated.
Figure it out. At the bottom right of VS Code, click the button that says 'Postgres' as shown here:
You can then select/search whichever language you want to use. Mine was on SQL, and I changed it to postgresql.
When I save a method and get back to it later, all of my variable names become temp and all of my parameters becomes arg and the code indentation get changed.
Any thoughts on how I can fix this?
The behaviour that you are experiencing is not code formatting at all. You immage is experiencing an issue where it can't access original source code. Thus it uses a backup solution and decomples method bytecode. During the compilation process the variable names are erased, so they can't be re-created during the decompilation, and generic substitudes are used instead.
Now, why you are missing sources is another question. First of all it's important to check if you get some exceptions. Often these happen when you open or save your image, but also thaty may occur when you save methods.
Depending on the Pharo version you may be missing .changes or .sources files. This often happens when you more an image without moving other supporting files.
I'm using this plugin for intelliJ
Database Navigator
I just wanted a simple tool to check my sqlite database, now that the firefox plugin I use is no longer working with the latest firefox update.
Sad!
Anyway, the plugin is good... except it seems to have added it's own "clever" sql checker, that finds all the sql in my java files, and then tells me if there are problems with the sql.
All well and good, but this
slows down editing those java files
doesn't work, finding phantom errors
isn't needed. Who struggles with writing sql?
So right now I have a bunch of red "tick" marks down the side of any java file with sql in it, as the plugin imagines up issues where there are none. I'd like these to just go away, I don't need code telling me if my code works - any ideas
how?
Here is an example of this thing:
I don't want the sql "string" to be treated as special, I don't want "analysis" performed on it, I can write working SQL.
Every time i load this class, the ... whatever it is takes up time looking at all the strings, and then makes EVERYTHING red on the sidebar. I don't want to disable all inspections on this page, as I do like to see when my java code has an error.
I know it is possible to tell intellij to stop looking at strings, I had this setting before - and then my laptop was stolen, thank you thieves - and now I have setup my environment again, I don't have my notes on how to resolve this issue.
The strings are "analyzed" when they are used in some methods of the package java.sql.
Click on a string and press Alt+Enter to expand the suggestion list
Select "Language Injection Settings" to open the configuration dialog for "SQL"
Uncheck all the checkboxes, press "OK" and all errors must be gone
Technical note: Settings are stored in <USER>/<.IDE_VERSION>/config/options/IntelliLang.xml
SQL dialect is not configured
this is mine mapper.xml,i want to clear Warning
Anytime you get the light bulb, if you hit AltEnter / ⌥↵ you will most often get a list of quick-fixes (or intentions). In this case you will should get an option to inject the language, or to edit the language injection settings. It's not clear what type of file you are editing in your screenshot (it's obviously some type of XML like markup). So I'm not 100% sure which quick fix (if any) will be available in that context.
You can also take a look at this SO answer -- https://stackoverflow.com/a/30759243/1348743 -- of mine as it provides a lot more detail about other ways of configuring SQL dialects. Also look at the IntelliJ IDEA help documentation on Using Language Injections.
idea -> setting -> SQL dialect
sql dialect
see the right column 'sql dialect',default value is 'Generic'.
change it to your own db name
I'm going to analysis two different versions of the same dll with fxcop.
I would like to display only the differences between these two reports.
Does anyone know if this is possible ?
Thanks for your time.
Yes, it's possible, but there are no built-in tools available for this. One fairly simple approach would be to use a diff tool to compare the two reports. If the result is too noisy for you, another approach would be to roll your own tool to compare the XML of the two reports.
Are you using UI or the command line?
With the command line tool, you have a number of options. One of them is to import an old report to be used as a baseline. Then set the fxcop project to report only new errors: Report Status="Active, Absent" NewOnly="True"
The command line will be something like this: fxcopcmd.exe /i:OldVersionReport.xml /out:NewVersionReport.xml /p:FXCopProject.fxcop /f:mydll.dll
The new report will have only new active error and also a list of missing i.e. fixed errors from the old version.
While this will work for the most part, you need to understand that the difference will not be 100% acurate. FXCop does its best to match old report to the new version of the DLL, but sometimes it fails. For example, if you fixed a particular violation somewhere in code, but added the same type of violation in another place, FXCop will most likely miss this and show no difference.
For FxCop VS 2010 , all you need is to have /saveMessagesToReport:Absent along with the older generated FxCop file /import:"OldFile.xml" specified .
Just an eg.
fxcopcmd.exe /import:"c:\Old.xml" /summary "/file:c:\*.dll"
/saveMessagesToReport:Absent /out:"c:\Output.xml"