Intellisense suggest not showing items returned by provideCompletionItems - visual-studio-code

I have an extension under development, and most of the time provideCompletionItems correctly displays the items returned by provideCompletionItems as suggestions.
VSCode Version: 1.45.0
OS Version: Mac 10.15.4
However, in some cases, when I am for sure returning items as an array, I see "No suggestions." Screenshot:
You can see in the DEBUG CONSOLE I am printing to the debug log an array of length 2 just before I return it as the completion items results. Relevant code here:
https://github.com/kortina/vscode-markdown-notes/blob/ak-bug-reference/src/extension.ts#L146
Is this a bug with VS Code that I should report, or am I misunderstanding the functionality of provideCompletionItems / do I need to do something else to have this reliably show the suggestions I am returning?

I have seen similar behavior and it turned out that I did not specify the range for the suggestion correctly. The engine returned many valid suggestions but the editor decided to show only the "No suggestions" message. So, double check the range in your completion items.

Related

Error handling in Sublime Text Plugin API

I'm creating my first sublime plugin to be used internally and was wondering if there's a way to stop the plugin from executing and display an error message on screen like an alert?
I took a look at view#show_popup() but this didn't render for me. Below is how I attempted to show it:
if "WebContent" in subdirectories:
directory = ROOT_DIR + "/WebContent"
elif "Content" in subdirectories:
directory = ROOT_DIR + "/Content"
else:
self.view.show_popup('Directory not found', location=-1)
Working Principle:
The plugin takes some data from one view and then pastes them in another view. The plugin has two TextCommands. One command takes the data from the first view, opens a new view and then executes the 2nd command on the new view. The above snippet is in the 2nd command.
I was unable to find any resources to help with show_popup() or any other error handling.
Does any one have possible ideas?
view.show_popup() is for showing things like hover popups next to the cursor; it's used for things like the built in functionality for going to references/definitions for functions:
While you could in theory use this for error messages, it may not be the sort of user experience that anyone would expect.
Your code above is technically valid, but since the content is expected to be minihtml it may be hard to see because as just a single string all you're going to see is just the text (i.e. you have no font style, padding, etc):
Perhaps more importantly, when location is -1, the popup appears at the point in the buffer closest to the first cursor position, so depending on your circumstance it may be appearing in a place you don't expect, and then vanishing away before you can scroll to see it, etc.
What you want here is sublime.error_message(); given a string, it will display that string in a dialog for the user to interact with, and it also logs the error into the Sublime console as well so that there's an additional trace.

Where to find "Log Dyld API Usage" and "Log Library Loads" on XCode 11?

I want to disable the printing of Logging Dynamic loader events (dyld) in the XCode console. I found a solution here.
But I couldn't find Log Dyld API Usage and Log Library Loads options in product scheme diagnostics of XCode 11. Please help me find them.
PS: If there is a new process in Xcode11 for disabling logs, please let me know.
Answer: This step by step solution is suggested below in the answers. I am just attaching this picture for a better understanding.
Dynamic loader
Events environment variables
One would say that you can set environment variables like DYLD_PRINT_APIS=0, DYLD_PRINT_APIS=false, DYLD_PRINT_APIS=no, ... but it doesn't work in this way. Check the source code:
else if ( strcmp(key, "DYLD_PRINT_APIS") == 0 ) {
gLogAPIs = true;
}
In other words gLogAPIs is true when the variable exists. You can set it to whatever value, keep it empty, it will be always enabled if the variable exists.
Xcode scheme
UI for this setting is gone in the Xcode 11, but it can still be in the scheme file. Let's say that you have a simple project Foo. The scheme is located at Foo/Foo.xcodeproj/xcshareddata/xcschemes/Foo.xcscheme1). It's a XML file. Quit Xcode and open this file in any editor and search for the LaunchAction element.
There will be:
LaunchAction element attribute like enableAddressSanitizer = "YES"2) or
DYLD_... environment variable set.
Just remove this attribute/environment variable and you should be fine.
1) The exact path can vary, because it the scheme can be included in the workspace, project, ...
2) I don't have a previous version (10) of Xcode installed, can't check for the exact name, but it should be there and it will be obvious which one it is. This one, I used, is for the Address Sanitizer checkbox. If you find the exact name, let me know and I will update this answer or answer it yourself and I'll delete this one.
Update
Instructions above helped OP to find exact XML element names. One has to remove:
LaunchAction/AdditionalOptions/AdditionalOption elements
where the key is either DYLD_PRINT_LIBRARIES and/or DYLD_PRINT_APIS

Get Status of Driver Inside Visual Basic

I'm currently trying to detect which drivers appear as "not working" in visual basic.
This unknown device is a good example of what I'm trying to grab (notice how it has the flag DN_HAS_PROBLEM).
I've tried using searches such as:
Dim searcher As New ManagementObjectSearcher( "root\CIMV2", "SELECT * FROM Win32_SystemDriver")
And running a loop in the searcher.Get() through this documentation
However, none of these seem to return what I am looking for.
Would anyone happen to know how I can get the DN_ statuses within Visual Basic?
Thanks!
The Win32_SystemDriver class documentation lists these Status properties:
OK
Error
Degraded
Unknown
Pred Fail
Starting
Stopping
Service
Stressed
NonRecover
No Contact
Lost Comm
...whereas DN_HAS_PROBLEM comes from the CM_Get_DevNode_Status function, or perhaps also from other system calls.
There may not be a way to get that specific code from the API you're using, but perhaps the existing Status properties will suffice for your needs if you don't need to know more specific failure reasons.
If you do need to know that specific status, you'll have to call other APIs, like the one I called out.

ag search results has corrupted messages in emacs

Recently my ag search results have started returning corrupted results like this:
[[?25h^[[0G^[[?25h^[[0Gapp/config/development.coffee:49:33:#
I am unsure as to why this has suddenly started happening.
Not sure what your context is exactly, but FWIW if you add --vimgrep as an argument to ag then you shouldn't get color codes in the response.

Crystal Reports 8.5 / 9 - How do I remove a "default" value for a parameter?

Can anyone enlighten me on how to find and remove a default parameter in Crystal Reports 8.5 and/or 9? I get all confused by visual code techniques like this where I can't just grep the codebase and find the string I need to remove. :D
Basically, it looks like the former developer saved the report with a couple parameter fields populated, and I'm not sure how to un-populate them. So when I open this report for the first time and execute it, it just asks me for my database credentials - I never even see the:
Use current parameter values
Prompt for new parameter values
radio button selection the first time it is executed.
Any advice is appreciated.. thanks in advance!
In case anyone else happens upon this and needs a solution:
I have to uncheck
File -> Options -> Reporting -> Save Data With Report.
May this make your Crystal Reporting just a little less traumatic.