Tracking document types beyond file extensions
Is your feature request related to a problem? Please describe.
I think it would be useful to be able to distinguish what type of file is currently open, beyond the file extension. R has many document types that are defined by the document's content, rather than the file extension. E.g., a plumber file is distinguished by the presence of plumber tags, such as # @get.
Once we are able to distinguish a document's type, we could look into document-type specific features.
Describe the solution you'd like At https://github.com/ElianHugh/vscode-R/tree/watch-doc-type, I've tried my hand at implementing a document type watcher. It uses a readFileStream that is tested with a regex at each chunk, so as to try to exit reading as soon as possible. It also uses a document cache, so that we only check the type when the document is changed.
The main issue, I think, is regarding performance. For instance, will reading large files take too long? Will re-reading be a performance hit? I'd love any insights into this!
This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.