Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1026755 // fixFunctionIncludeSnippetName

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (8733L/50K).

static Offer fixFunctionIncludeSnippetName(S snippetID) {
  if (!isJavaXIncludeSnippet(snippetID)) null;
  S text = loadSnippet(snippetID);
  S fname = first(findFunctionDefsAtCurlyLevel(0, text));
  if (empty(fname)) null;
  S title = snippetTitle(snippetID);
  LS tok = javaTok(title);
  if (neq(firstToken(tok), fname)) {
    tok.set(1, fname);
    ret Offer("Rename snippet " + snippetID + " to: " + join(tok),
      r { renameSnippet(snippetID, join(tok)) });
  }
  null;
}

Author comment

Began life as a copy of #1026389

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026755
Snippet name: fixFunctionIncludeSnippetName
Eternal ID of this version: #1026755/4
Text MD5: 0e1ca33b5724ed0c964834a64a96d9e1
Transpilation MD5: d93bc7adcacc73ef0ebd1e034d64643c
Author: stefan
Category: javax / snippets
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-10 00:20:31
Source code size: 491 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 192 / 312
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)