BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
6 stars 6 forks source link

introduce output level for BBj to suppress irrelevant output #158

Open StephanWald opened 1 week ago

StephanWald commented 1 week ago

The story behind:

I probably have a unique setup, but one of my VSCode workspaces is located on a remote cloud drive (think Dropbox). Since it's on a cloud drive, I can work on the project from different machines. Therefore, while it appears as though my files are hosted on a local drive, they're actually on a remote server. Because of that, they cannot be accessed as quickly as files that are actually on my computer's SSD. The end result is that I get 8,000+ lines similar to the following in the BBj Output:

Linking (>100ms) file:///Users/ndecker/Library/CloudStorage/Sync/development/git/DWCProjects/FileSearcher/FileSearcher.bbj took 192ms

That's due to this code in the bbj-linker.ts file:

        const elapsed = Date.now() - started
        const threshold = 100
        if (elapsed > threshold) {
            console.debug(`Linking (>${threshold}ms) ${document.uri} took ${elapsed}ms`)
        }

Because there are thousands and thousands of informational messages in the BBj Output that refer to linking times exceeding 100ms, I can't find actual errors or problems. IOW, there's too much noise, making it impossible to find the signal (any useful information) buried amongst tons of linking messages.

It would help me tremendously if this could be addressed in some way, as it's almost impossible for me to locate actual warnings and errors. I currently have to copy the BBj Output into my editor and execute a regex in order to remove all the linking messages and see if there are any errors or warnings.

I can think of a few different solutions: Separate the errors, warnings, and informational messages (like the browser's Developer Tools Console does) Add a configuration property that lets me set the level of output messages (like BBj and the Eclipse plug-in do) Add a configuration property that lets me set the threshold value to something other than a hardcoded value of 100ms I don't know enough about VSCode Extensions and what's available to us to say what's possible and the best solution. But there are a number of ways to prevent all of the linking messages from appearing in the BBj Output, which I personally don't find to be helpful. The linking time may be useful to others in some scenarios, but it's making it difficult for me to be able to see problems that the extension encountered at a glance.

dhuebner commented 6 days ago

@StephanWald This is a developer debug log, we can just remove it or comment out.