I know how to create a new command or an environment. I think it will much better if I can specify name of the arguments. For example in framebox command and array environment below, we know exactly what're the arguments that should be passed.
\framebox(xdimen,ydimen)[position]{text}
\begin{array}[pos]{cols}
content...
\end{array}
So far, I've tried
\documentclass{article}
\def\testdef#1#2{#1 #2}
\newcommand{\testcommand}[2]{#1 #2}
\newenvironment{testenv}[2]{#1}{#2}
\begin{document}
\testdef{arg1}{arg2}
\testcommand
\begin{testenv}{1}{2}
content...
\end{testenv}
\end{document}
and you all can see, \testdef{arg1}{arg2} just print arg1 and arg2 while I need to naming them with, for example, name and value. It should be
\testdef{name}{value}
The same goes also for \testcommand and testenv. So, How can I do that?
Edit
These pictures is taken from TeXstudio.
In picture #1, we see what are arguments for
\framebox.
while in picture #2, we just see
\testdef{arg1}{arg2}.
Is it behavior of Latex editor? or we can tune it through latex macro?


\testdef{arg1=value1, arg2=value2}in which case you should look at the keyval package (or extended versions such as xkeyval or l3keys) – David Carlisle May 07 '14 at 08:18\defyou are just asking for two usual arguments{…}{…}, optionals are a bit more tricky. In\newcommandyou are doing the same, you need\newcommand\testcommand[2][]{#1 #2}or something similar. And in the\newenvironmentthere is a problem, the arguments can only be used in the “opening”; usually in the\beginsome variables are defined with the arguments, and then in the\endthey are used. Again, you need\newenvironment{testenv}[2][]{…}{…}. Take a look atxparse. – Manuel May 07 '14 at 08:19\begin{array}[<pos>]{<cols>}uses<pos>and<cols>as place-holders to show what is going on, but in the code you still need#1,#2, etc. In TeX parameters have numbers, not names (you can work-around this in LuaTeX, but that I know of this has only been done in ConTeXt and not in LaTeX). – Joseph Wright May 07 '14 at 08:21.cwlfiles: see e.g. http://tex.stackexchange.com/questions/79643/texstudio-does-not-recognize-colon/85220 for some discussion of altering/adding them. The thing is that this requires knowing what commands to add: are you looking to extend by a 'fixed' set of commands? – Joseph Wright May 07 '14 at 10:38