'VSCode Intellisense is slow when auto-completing from big enums

I have an enum declaration that is ~20k lines long.

When using Intellisense to auto-complete from that enum, it takes about 9s for the results to show.
Looking at the TS Server logs with "typescript.tsserver.log": "verbose", I see that getCodeFixes takes about 9s to complete.

Perf 814  [14:38:57.924] 211::getCodeFixes: elapsed time (in milliseconds) 9099.8933
Info 815  [14:38:57.927] response:
    {"seq":0,"type":"response","command":"getCodeFixes","request_seq":211,"success":true,"body":[{"fixName":"fixMissingMember","description":"Add missing enum member 'Impfes'","changes":[{"fileName":"e:/Source/zerotoheroes/hs-reference-data/src/card-ids.ts","textChanges":[{"start":{"line":1,"offset":1},"end":{"line":20865,"offset":2},"newText":"export const enum... (full enum text here, truncated) 

Is there a way for me to disable that check? I am only interested in auto-completion, and will never want to add an enum member in that situation.

Thanks!



Solution 1:[1]

This is an easy way of letting the package decide to proceed based on whether a specific SQL Agent job is running at the time the package is invoked.

To do so:

Create an Execute SQL task component at the start of your package.

Give it a query that will ask [msdb] on the execution status of the SQL Agent job you are interested in. Like so:

USE [msdb];

SELECT ISNULL(MAX([sj].[name]),'') AS [JobRunning]
FROM [msdb].[dbo].[sysjobactivity] AS [sja]
INNER JOIN [msdb].[dbo].[sysjobs] AS [sj]
ON [sja].[job_id] = [sj].[job_id]
WHERE [sja].[start_execution_date] IS NOT NULL
      AND [sja].[stop_execution_date] IS NULL
      AND CAST([sja].[start_execution_date] AS DATE) = CAST(GETDATE() AS DATE)
      AND ISNULL([sj].[name],'') LIKE '%NameOfSQLAgentJobThatNeedsToNotBeRunnimg%';

And as shown in the screenshot:

adding the SSIS component

Make sure to set the result set property to single row and to create a Package scoped variable to hold the returned value.

Like so:

adding the appropriate variable

And then you need to add the fist step of the Package logic whatever that might be and connect the two.

enter image description here

When you have connected the two, edit the Precedence Constraint and set it to Expression and Constraint and upon Success set the code to:

@[User::JobRunning]!="NameOfSQLAgentJobThatNeedsToNotBeRunnimg"

like so:

enter image description here

And that's it. Save, build, deploy :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 scorpiophd