Theme Running Code

Flags theme type extensions that run code on the user's machine. Themes should be static JSON files and not execute any code.

Auto-Installs Additional Extensions

Flags items that automatically install additional extensions as part of their installation. While this is a common way to distribute curated toolsets, it results in other extensions being installed silently - bypassing individual policy evaluation and running code the user never explicitly chose to install.

Process Execution

Flags items that initiate new processes by executing files from local or remote paths. This behavior can be used to run additional code outside the extension’s scope, including potentially malicious payloads. Uncontrolled process execution increases the risk of system compromise.

This Visual Studio Code extension provides language support tools for the Papyrus language, specifically for files with the 'dfa' language identifier. It includes features such as syntax highlighting, code validation, and a preview mechanism for compiled output.

Key Functionalities and API Usage

  • Language Server Integration:
    • Uses vscode-languageclient to start a language server implemented in Node.js (server.js) for enhanced language features.
    • Registers the language server for files with the 'dfa' language.
  • Command Registration:
    • Registers a command papyrus.preview that opens a PDF preview of the compiled output in a side editor pane.
  • File System Watching:
    • Watches for changes to .clientrc files to synchronize with the language server.
  • Compilation on Save:
    • On saving a 'dfa' file, the extension:
      • Creates or shows an output channel named "Papyrus".
      • Executes an external compiler executable (C:\ISIS\pdew3710\pdew3.exe) with the corresponding .prj project file and a /FORCEPDF=Yes argument to force PDF generation.
      • Captures and displays stdout and stderr from the compiler in the output channel.
      • Shows success or error messages based on the compiler's exit code.
      • Optionally auto-previews the generated PDF if configured.
  • UI Behavior:
    • Changes the VS Code color theme to "dfa-dark" when a 'dfa' file is active.
    • Opens the generated PDF using a custom editor (pdf.preview) in a configured view column.
  • Process Execution:
    • Uses child_process.execFile to run the external compiler.

Potentially Sensitive Operations

child.execFile('C:\ISIS\pdew3710\pdew3.exe', [prj_file_path, '/FORCEPDF=Yes'], { timeout: ... })
  • This executes an external binary on the local machine.

  • The extension reads and writes files within the workspace (e.g., .dfa, .prj, and generated .pdf files).

  • No network communication, registry access, user creation, clipboard access, or persistence mechanisms are present.

  • No obfuscation techniques are used; the code is straightforward and readable.

Summary

The extension facilitates development in the Papyrus language by integrating a language server and automating compilation with PDF preview. It executes a local compiler binary on save but does not perform network communications or other sensitive operations.

Licenses

MIT License

View License

Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation file...

See More