vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Tracking document types beyond file extensions

Open ElianHugh opened this issue 4 years ago • 1 comments

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!

ElianHugh avatar Sep 21 '21 03:09 ElianHugh

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Sep 22 '22 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 07 '22 02:10 github-actions[bot]

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Oct 09 '23 01:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 23 '23 01:10 github-actions[bot]