爱意满满的作品展示区。
klesh

VSC 插件 Selection Converter : 用自定义函数对选中文字进行转换

  •  
  •   klesh · Nov 24, 2019 · 3468 views
    This topic created in 2373 days ago, the information mentioned may be changed or developed.

    今天写个小玩意的时候,需要做大量的转换。

    需要将

    export interface TrFile {
       // 下面是从文档上直接 copy 下来的
       "cookies"            | string      pointer to a string of one or more cookies.
       "download-dir"       | string      path to download the torrent to
       "filename"           | string      filename or URL of the .torrent file
       "metainfo"           | string      base64-encoded .torrent content
       "paused"             | boolean     if true, don't start the torrent
       "peer-limit"         | number      maximum number of peers
       "bandwidthPriority"  | number      torrent's bandwidth tr_priority_t
       "files-wanted"       | array       indices of file(s) to download
       "files-unwanted"     | array       indices of file(s) to not download
       "priority-high"      | array       indices of high-priority file(s)
       "priority-low"       | array       indices of low-priority file(s)
       "priority-normal"    | array       indices of normal-priority file(s)
    }
    

    转换成:

    export interface TrFile {
      // 下面是转换后的
      "cookies": string               // pointer
      "download-dir": string          // path
      "filename": string              // filename
      "metainfo": string              // base64-encoded
      "paused": boolean               // if
      "peer-limit": number            // maximum
      "bandwidthPriority": number     // torrent's
      "files-wanted": array           // indices
      "files-unwanted": array         // indices
      "priority-high": array          // indices
      "priority-low": array           // indices
      "priority-normal": array        // indices
    }
    

    找了半天没有合适的工具, 因此自己撸了一个插件来调用自定义函数对选中文件进行修改。

    插件地址: https://marketplace.visualstudio.com/items?itemName=kleshwong.selection-converter

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3515 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 11:15 · PVG 19:15 · LAX 04:15 · JFK 07:15
    ♥ Do have faith in what you're doing.