This means we can ditch the whole approach of trying to remove
stale ScriptInfo instances at plugin startup, instead just
endowing existing ones with new behaviour.
This repairs an error where renaming an identifer would perform
spurious edits.
TypeScript has been moving on while the plugin has been staying still, and
that has caused the plugin to stop working well. This patch gets things
back into somewhat workable state, but I'm sure more will be required.
Changes include:
- `hookHost` is no longer required: instead, we hook ts.createSourceFile.
- `shouldExpand` abstracts away details of whether a file is considered
Syndicateish or not.
- The code that does the Syndicate expansion has been abstracted out of
the detail of how expansion is invoked by the language server.
- I've had to monkey-patch ScriptInfo in order to get access to the
`editContent` method.
- As a consequence, at plugin startup, we invalidate existing ScriptInfo
instances so they are rebuilt with our SyndicateScriptInfo constructor.