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

14
LINES

< > BotCompany Repo | #1006585 // autoRenameSnippet

JavaX fragment (include)

1  
static void autoRenameSnippet(S id) {
2  
  if (getSnippetType(id) == 42) { // JavaX fragment
3  
    S text = loadSnippet(id);
4  
    L<S> names = findFunctionDefinitions(text);
5  
    if (nempty(names)) {
6  
      S f = first(names);
7  
      S title = getSnippetTitle(id);
8  
      if (!title.startsWith(f)) {
9  
        title = f + addPrefixIfNotEmpty(" - ", title);
10  
        setSnippetTitle_verbose(id, title);
11  
      }
12  
    }
13  
  }
14  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006585
Snippet name: autoRenameSnippet
Eternal ID of this version: #1006585/1
Text MD5: c5419227988997dc3f734eefa1a30cb9
Author: stefan
Category: javax / automation
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-19 00:09:54
Source code size: 421 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 462 / 496
Referenced in: [show references]